- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2024 10:03 AM
I know there are multiple threads on this but I have had no luck. For example add Website to whitelist. This RITM will go to 4 Security people where only one needs to approve. If they reject or simply add a comment we want that comment to copy to the Parent RITM. I have looked at many threads and all are not working for me.
Business rule
Table - Approval [sysapproval_approver]
When to run- Before / on Update / filter - I have it set to Comments changes.
My current Script- Not sure how close this is to working
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2024 12:18 PM
Hi @Tfnhodgi
you can write before business rule and use the below Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
// Get the parent RITM (Request Item)
var reqitem = new GlideRecord('sc_req_item');
reqitem.addQuery('sys_id', current.document_id);
reqitem.query();
if (reqitem.next()) {
reqitem.comments = reqitem.comments + "\n" + current.comments.getJournalEntry(-1);
reqitem.update();
}
})(current, previous);
It is working in my pdi
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2024 03:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2024 05:58 AM
Strange... Here is what I have setup on myside. Only other thing is we have a Work Note that populates when this ticket is created. Can that break this code by any chance? I am confused why this isn't working for me. I appreciate your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2024 06:28 AM
Hi @Tfnhodgi
In my PDI the same code is working and based on your information provided I think the work notes code is affecting may be.
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2024 05:30 AM
Hi @SAI VENKATESH thank you for troubleshooting this with me. I created a new CI without the worknotes and the code worked as it should. Weird how adding notes through the flow would stop this but we figured it out. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2024 08:39 AM
Just wanted to update. It is not the worknotes. Not sure what it is causing it not to work on the old CI, but it has to be on the Catalog item side from my testing. I will update when I figure out what is causing the old one not to work.