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.

URGENT :Calculating Duration of an SCTASK & RITM.

Mounika B1
Tera Contributor

I  want to calculate "duration" for task & RITM"
For incident, we can calculate "duration", but I can't calculate it for task.
If the item is Open:
Display the time elapsed from the request submission date to the current date.
If the item is Closed:
Display the time between the opened date and the closed date.

 

11 REPLIES 11

Mark Manders
Mega Patron

Why can't you calculate that? It works in the same way. How are you calculating? Are you using OOB metrics, PA, custom code? 

When you say something is 'urgent' you need to provide enough information that we can help you. Especially because you don't even mention why you can do something on one record that you can't do on another, while those records have the exact same fields.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi Mark ,

Thanks for the response,

why am using urgent means , I got requirement to be complete by EOD.
this the requirement  :

If the item is Open:
Display the time elapsed from the request submission date to the current date.
If the item is Closed:
Display the time between the opened date and the closed date.

 

The calculation should be consistent across both RITM and SC Task records.
The duration should be displayed in a clear format (e.g., X days Y hours).

i have tried OOB, but no luck .i saw few community link where there are suggesting needs create 2 custom variables, but it is not acceptable. 
1. I want duration should calculate the request item  is opened how long its opend(days or hours) 
2.I want to calculate  how long its takes time  to close or resolved the request 



Ankur Bawiskar
Tera Patron
Tera Patron

@Mounika B1 

this already happens on incident and checks created on and closed at date/time.

you can try to check that OOTB BR and ensure the same thing is configured for RITM table

when RITM is completed, the Closed field is populated as well

This is the OOTB BR on incident

AnkurBawiskar_0-1763554391057.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Mounika B1 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader