
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2020 06:18 AM
Hi,
How can i make a business rule to change incident state of incidents pending change when this change is implemented?
all help is welcomed 🙂
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2020 06:38 AM
Hi Teresa ,
try this script :
write an after insert / update business rule on incident table
var gr = new GlideRecord('change_request');
gr.addquery('parent',current.sys_id);
gr.addquery('state',7);
gr.query();
if(gr.next())
{
current.setValue('incident_state',6);
current.update();
}
Mark my answer correct and helpful based on impact.
Regards,
Apeksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2020 06:53 AM
Hi,
Write After Business rule on change_request table. Condition would be
State changes to 6 (Give condition in When to run Section of business rule).//choose state as per your requirement so that this business rule will triggered as per the condition provided in Filter tab.
You can try above script that @Namrata provided.
And one more thing while querying table use below addQuery() it also worked.
gr.addQuery('parent',current.getValue("sys_id"));
Thanks,
Kunal.