Changing the Assignment group of List of Incidents which are in closed state

Black Coder
Tera Guru

There is a list of incidents which are in Closed state. We are in a situation to change the assignment group of all those incidents without changing any group. But right now when we try to change the group for those closed incidents, the state is also changed to "New" state.

 

What is the approach we have to follow in order to change only the assignment group of closed incidents without changing any other fields?

 

1 ACCEPTED SOLUTION

SANDEEP28
Mega Sage

@Black Coder  There  must be some custom business rule or client script which is changing status of incident record to New state. But we are using "grIncident.setWorkflow(false)" in our script which will prevent execution of any business rule or client script. 

 

To replicate this issue, I created custom business rule which is changing the status of incident record from "Closed" to "New" when assignment group changes

 

SANDEEP28_0-1690787307424.png

 

SANDEEP28_1-1690787346218.png

 

I ran below code without setWorkflow(false), then it changed state of incident to New because business rule got executed

 

var grIncident = new GlideRecord('incident');
if (grIncident.get('470af5afa9fe198101b324dd773ef379'))  //incident sys_id
{
grIncident.setValue('assignment_group', '8a4dde73c6112278017a6a4baf547aa7', 'Software');
grIncident.update();
}

SANDEEP28_2-1690787538870.png

 

I ran below code with setWorkflow(false), then it does not changed state of incident to New because business rule didn't executed

 

var grIncident = new GlideRecord('incident');
if (grIncident.get('e329de99731423002728660c4cf6a73c'))  //incident sys_id
{
grIncident.setValue('assignment_group', '8a4dde73c6112278017a6a4baf547aa7', 'Software');
grIncident.setWorkflow(false);
grIncident.update();
}

SANDEEP28_3-1690787744196.png

 

Could you please share screenshot of script which you are executing

 

 If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !! 

 

 

View solution in original post

5 REPLIES 5

SANDEEP28
Mega Sage

@Black Coder Great to hear that.