Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Best way to calculate duration of the ticket created on custom table ?

Liyakhat
Mega Sage

we have a custom table which is not extended from task

 

we have a ticket on which we need to show to the agent how much time is elapsed once the ticket is created

we have created a field type duration and updating time for every minute on it using schedule job which runs every minute after the ticket is created filtering closed ones

 

will this effect performance? ,Any best possible way other than this to calculate time on a ticket 

8 REPLIES 8

If your table does not extend task then the only viable option would be to add a 'duration' field to the table and calculate the value, but allowing for values with meaning IE allowing for schedules\business hours is probably going to make the calculations complicated and it might just be easier to migrate your solution to a table extended from task.

 

Also as indicated in my earlier post I expect that calculating the value every minute would result in performance impact to your instance and would suggest that you use a less frequent scheduled job IE every hour, and an on load client script so that the duration is recalculated\updated for any record that is opened in the UI.

Sorry mate, I was in wrong impression. You are right. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Good Thanks For Help I Am Also Searching About That

Tony Chatfield1
Kilo Patron

Hi, with regard to your question will this effect performance.

Based on the details that you have supplied, yes the configuration is very likely to impact performance of your instance; If not initially (when record volumes are small) then definitely in the future and I would not consider this to be a scalable solution.
These SNC doc's provide a basic overview as to how\when SLA is calculated and why.
Why do task SLAs not get updated on refresh in Dashboards / Homepages / Reports? - Support and Troub...

 

When are SLAs calculated? - Support and Troubleshooting (servicenow.com)