- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 06:17 AM
Hello Community,
We have a notification to be triggered whenever an incident gets updated, although the problematic part is that there should be some exceptions, and not sure how to implement the exceptions.
So the notification is being triggered currently whenever a new addition comment or work note will be added, but we would not some exception.
Exceptions: 1. Attachment has been added to the incident (it will be shown as additional comment therefore it triggers currently)
2. Knowledge base article has been attached to the incident (the number and short description of the KB article is added currently as work notes, so it triggers the notification as well)
Could somebody help me how to set up these exceptions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 07:22 AM
Hi,
It's quite difficult to achieve your requirement.
One approach you can try is, you can set one flag something like attachment_notes_added=true in the business rule or script which is adding work notes for your attachments, use the same flag in your BR as something like below condition :
work_notes.changes() AND attachment_notes_added=false; then only trigger notification
Note: instead of flag variable, you can try setting the flag with g_scratchpad object but not sure this will work but above flag field approach should work. Also make sure that you revert it to false everytime.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 07:12 AM
Hello Mate,
You would have to create an advanced condition that will query the sys_attachment table and validate the update being made is not an attachment and also validate the update is not a KB relationship.
You may be better off using a business rule to fire an event that triggers your notification wherein you validate the ticket being updated does not have a new attachment added and the update is not for the KB Article field. (aka. Trigger when not one of your exceptions rather than always trigger and catch exceptions)
Please mark my answer as correct/helpful if it has helped you.
Thanks,
Logan
--
LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 07:22 AM
Hi,
It's quite difficult to achieve your requirement.
One approach you can try is, you can set one flag something like attachment_notes_added=true in the business rule or script which is adding work notes for your attachments, use the same flag in your BR as something like below condition :
work_notes.changes() AND attachment_notes_added=false; then only trigger notification
Note: instead of flag variable, you can try setting the flag with g_scratchpad object but not sure this will work but above flag field approach should work. Also make sure that you revert it to false everytime.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP