- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2023 11:07 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 12:16 AM
@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
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();
}
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();
}
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 !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 12:28 AM
@Black Coder Great to hear that.