- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 07:37 PM - edited 04-27-2023 07:08 PM
Is there a way to update the work notes for the related issue record when the change management is closed?
Best regards, and thank you in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 10:23 PM
yes it's possible.
you can use after update BR on Change Request Table
Condition: State Changes to Closed
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("problem");
gr.addQuery("rfc", current.getUniqueValue());
gr.query();
while (gr.next()) {
gr.work_notes = 'The associated change request ' + current.number + ' is closed';
gr.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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 10:23 PM
yes it's possible.
you can use after update BR on Change Request Table
Condition: State Changes to Closed
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("problem");
gr.addQuery("rfc", current.getUniqueValue());
gr.query();
while (gr.next()) {
gr.work_notes = 'The associated change request ' + current.number + ' is closed';
gr.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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 10:37 PM
Thank you very much.
My wish has been granted by following your instructions.