if new ritm and old rejected ritm having same details need to send email with rejected ritm details
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 10:55 AM
Hi Community,
I have a requirement that when we creates new RITM through catalog(manual/automation tickets),
If newly created RITM and Rejected old RITM having the same details(any one of common fields), we need to trigger an email notification with the old rejected RITM details with that approval Rejection comments.
I have created notification on "sysapprover" table with event fired condition through Business rule(after update & state changes to rejected). (this single rejection comments i can able to trigger correctly).
But as per my requirement i need to trigger when new RITM created. I have created new Business rule after insert on Requested_item table and called the same event. It is not working.
Can anyone please suggest on this. Is this correct way or not ?
Can we implement this scenario or not please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2024 08:30 AM
ok before eventQueue() write this logic...note this is sample code
var comments = [];
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', rejectedRitms.sys_id);
gr.addQuery('state', 'rejected'); // Filter for rejected approvals
gr.query();
while (gr.next())
{
comments.push(gr.comments.toString());// Assuming 'comments' is the field storing the rejection reason
}
var rejct = comments.join('\n');
then pass rejct in event Queue and print in email body