Write a bussiness rule when incident is closed then associated problem will be closed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 09:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 07:23 PM
Hello @S Kuanar
Did you tried to debug BR ? You can add gs.log statement or utilize script tracer feature and check is your br triggered or not and what is happening? Give a more try so you will get expert in debugging issues. Also, try such script in background for one record and see if it works or not if it's good go and apply in br so it will work for all records where conditions are matched as placed by you.
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 04:08 AM
Hello @S Kuanar
I believe you are doing great.
Did my reply answer your question?
If my response helped, please mark it correct and close the thread so that it benefits future readers.
Thanks & Regards
Viraj Hudlikar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 07:59 PM
Hi @S Kuanar
Refer the below link
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 08:51 PM
your script is wrong.
business rule should be after update on INC when state changes to Closed
Script as this
(function executeRule(current, previous /*null when async*/) {
var inc = new GlideRecord('problem');
inc.addQuery('sys_id',current.problem_id);
inc.addQuery('state','!=',4);
inc.query();
if(inc.next()){
inc.state = 4;
inc.update();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader