How to know my BR ran on the RITM, or if the trigger was missed

David Long
Tera Contributor

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!

4 REPLIES 4

benn23
ServiceNow Employee
ServiceNow Employee

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?  

Anurag Tripathi
Mega Patron
Mega Patron

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?

 

-Anurag

Grow2Dev
Tera Guru

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.

Grow2Dev_1-1672939521341.png

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.

Grow2Dev_0-1672943211457.png

 

--

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 😉 


Community Alums
Not applicable

Zeeshan6_0-1732537924956.png
Open script tracer.

Zeeshan6_1-1732538057992.png

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.