Trigger Approval Notification on state changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I have a requirement to trigger approval notification only when state changes to Pre-Check Completed (custom state) on RITM. Currently It triggering only when approver is attached to RITM not on the states changes.
Please find the below event , BR , Notification condition overview and let me know where need to adjust the code.
event Name :precheck.completed
Table :sc_req_item
Br: Trigger Notifctaion on RITM PreCheck / After - Update
Table :Sc_req_item
script :
Notification
Table: sysapproval_approver
Condition: sysapproval.getTableName() == 'sc_req_item' && sysapproval.state == 15
Looking forward for your response.
Thank you in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
When using an event as the trigger, you want your Table to be the one that contains the data to be included in the email message, so sysapproval_approver is correct in your scenario, Remove the Condition from the notification as that is redundant - the event should only fire/trigger when the State is correct. The Business Rule changes are also not what you want as the event will now fire every time the RITM is updated and in the State, rather than only when the RITM State changes to your desired state. Put the Business Rule back the way you had it, then update a RITM record to this state. Check the System Logs > Events or System Policy > Events > Event Log to see if the Business Rule correctly fired the event.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
why not send the approval only when State Changes to Pre-check completed ? This is much easier to handle.
This way you need not create any BR, make any changes to OOTB notification etc?
You can make your Service Catalog Flow on your catalog item to wait till RITM State moves to Pre-check completed
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
3 weeks ago
Hi @Ankur Bawiskar ,
Thanks for reply,
No fulfiller wants to see the approver also , once he moved the state to Pre check completed only then approvers get notified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
that's what I am saying.
Trigger approval only when State Changes to your state and it will work for you.
You can use Wait logic in your flow associated to your catalog item.
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