The below script is triggering incorrect Events for notification .. how can I fix it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 01:40 AM
Hi All,
I have written a business rule which is triggering multiple events in the single script , for every of the email notifications for request , task it is triggering event : normal_change.approval.inserted ... in ideal scenario , for isRequest function it should trigger : request.approval.inserted event for isSCTask it should trigger event : sc_task.approval.inserted and so on , I am not pasting down the entire script , but there is some issue with the below part of the code which is everytime triggering : normal_change.approval.inserted for any of the function call .
How can I fix the below part ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 01:48 AM
Hi,
How the variable isnormalchange is getting calculated?
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 02:21 AM
Hi @Saurabh Gupta - isNormalChange is calling the function checkNormalChange and inside the function is the below script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 02:35 AM - edited 12-27-2023 02:36 AM
Hi,
To check if the approver triggered is on Normal change, you can use below script-
function checkNormalchange() {
if ( current.sysapproval.sys_class_name == 'change_request' && current.sysapproval.type=='Normal')
return true;
else
return false;
}
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 02:41 AM
Hi @Saurabh Gupta - approval do gets triggered on the normal change itself it is jus that for other functions like isRequest , isSCTask it is triggering event == normal_change.approval.inserted which in ideal scenario it should not and it should trigger specific events related to that functions which are there in the above script shared .
How can I fix that part ?