How to know my BR ran on the RITM, or if the trigger was missed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 08:25 AM
Hello!
I have a BR set to run each time the comments are updated on the RITM and then copy that comment down to the TASK level. It is working 99% of the time, but occasionally a comment is missed and I am unsure why.
Is there a way to see if the BR triggered but didn't run successfully or if the trigger was missed completely? I have around 10 RITM records to look at if there is a log or something else I could pull.
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 09:13 AM
I'm not aware of a way to retroactively trace the logs.
Are you certain that those tasks actually existed when the comments were made?
Are there any 'query' business rules against the sc_task table that might have prevented the commenter from viewing the task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 09:17 AM
You can't check this retrospectively.
You will need to replicate the scenario when it doesn't run, Common places to start would be to see if there are any scrips that have setWorkflow(false) or the BR in question has any conditions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 09:26 AM - edited 01-05-2023 10:27 AM
Hello @David Long
it always helps to add a log message to you Business Rule with the name of the BusinessRule and if needed with some values you want to check afterwards such as RITM number and/or the content of the comment.
Example:
gs.info('BR "CopyRITMCommentToTaskBR" for RITM with number: ' + current.getValue('number')');
You can also use gs.log() if you are in global scope.
In the System Log [syslog_list.do] table you can then filter for parts of your log message such as the Business Rule name and see for what RITMs it actually ran.
Then remove the filter and check your Logs for errors in general that coutl relate to your issue.
If you have several functions in your Business Rule you should add more useful log messages in order to see where it stops or if the BR or any of its functions gets triggered at all.
--
Here you can find a discussion on the same topic with a lot of useful tips:
https://www.servicenow.com/community/developer-forum/how-to-check-which-business-rule-has-run-on-req...
In Application Navigator you can also search for Debug and find the "Debug Business Rule" for debugging.
--
Hope some of this helps.
If you need further assistance on your issue, then I would recommend you to share more information regarding your configuration (when: before / after / async BR etc.). Screenshots help a lot 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 04:37 AM
Open script tracer.
Click on the start tracer Button
Run your task and the script tracer will record all the BR, Script include, UI Actions, etc., that got executed in the background.