- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi All,
I'm trying to implement approvals on RITMs and I'm using the approval.inserted event, however, that seems to also be used currently (in our environment) for change approvals.
Which event differentiates between approvals for change and approvals for RITMs?
Thanks in advance for any help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi @Cat
If the event is the same, we can add a condition in the email notification where the ticket number starts with CHG or RITM.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
if you want different email content then separate them out
1) update OOTB to include source table = sc_req_item (Since you are updating OOTB it will be skipped during upgrade)
2) create new notification with exact same event etc source table = change_request
OR
update the email scripts I shared as per your requirement
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
If it works, that’s great! I thought adding the condition wouldn’t work properly in the same setup, but I’m glad it does
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
this will work
Note: If you are updating OOTB notification then it will be skipped during the upgrade, that's the only risk
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi @Cat !!
There is no separate event for approvals created for Change versus RITMs.
The approval.inserted event is a generic event and is fired for all approvals in the platform, including:
Change approvals (change_request)
RITM approvals (sc_req_item)
Request approvals (sc_request)
Other approval-enabled tables
How to Differentiate Between Change and RITM Approvals
You must evaluate the source record of the approval.
On the sysapproval_approver record, the sysapproval field references the record that generated the approval.
Example logic:
var sourceGR = current.sysapproval.getRefRecord();
if (sourceGR.getTableName() == 'sc_req_item') {
// RITM approval
} else if (sourceGR.getTableName() == 'change_request') {
// Change approval
}
Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.
Regards,
Vaishnavi
Associate Technical Consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi @Cat !!
There is no separate event for approvals created for Change versus RITMs.
The approval.inserted event is a generic event and is fired for all approvals in the platform, including:
Change approvals (change_request)
RITM approvals (sc_req_item)
Request approvals (sc_request)
Other approval-enabled tables
How to Differentiate Between Change and RITM Approvals
You must evaluate the source record of the approval.
On the sysapproval_approver record, the sysapproval field references the record that generated the approval.
Example logic:
var sourceGR = current.sysapproval.getRefRecord();
if (sourceGR.getTableName() == 'sc_req_item') {
// RITM approval
} else if (sourceGR.getTableName() == 'change_request') {
// Change approval
}
Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.
Regards,
Vaishnavi
Associate Technical Consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
OOTB this event "approval.inserted" and email notification "Approval Request" is triggered on any approval insertion
This is same for CHG and RITM.
So you can't differentiate there.
You can differentiate that in the email scripts used by that OOTB Notification
These 2 email scripts are used by that email template
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
