How to calculate Age of the tickets?

taqdeer
Tera Contributor

Hi All,

I want to calculate the age of the incidents on the incident table.

Could some one please help me on starting from creating the Age field and till it calculates the age.

Thanks.

19 REPLIES 19

taqdeer
Tera Contributor

Hi Gaurav,

Thanks for the response.

But my requirement is not generate a report or create a performance analytics dashboard. 

I want to display the age of the tickets as a field on incident form. For an example : how we have created by , updated by , assignment group etc..  the same way field "Age" which displays the number.

 

taqdeer
Tera Contributor

Hi Sachin,

Thanks for the response.

But my requirement is not generate a report or create a performance analytics dashboard. 

I want to display the age of the tickets as a field on incident form. For an example : how we have created by , updated by , assignment group etc..  the same way field "Age" which displays the number.

 

Hi Taqdeer,

Any reason why you want to customize, when you have an OOB solution available?

Thanks

You could use SLAs that will automatically track your Incident open time. 

 

If you still want to go with customization route ( which I DO NOT recommend since it's expensive), you can follow below to calculate age on incident form,

 

 

1. There is already a 'duration' filed on the Incident table. Just put that on your form. This will display the time since the Incident was created until it reached the 'resolved' state

3. You could place a calculated field on the form. Just create a new field of Type Duration and put the below in the calculation script:

javascript:gs.dateDiff(current.sys_created_on, gs.nowNoTZ(), false);

Note: Calculated fields have a habit of slowing things down, so you may want to calculate this in a Display Business Rule and pass it into the form in the scraptchpad. 

 

Regards,

Sachin

Tushar Hirpurk1
Mega Guru

Hi Taqdeer,

              You can use the duration field for the same,

Please refer below link for the same.

it contains the creation of aging field in incident table.

 

https://community.servicenow.com/community?id=community_question&sys_id=fdd76b2edb2f5b44d58ea345ca96...

 

https://community.servicenow.com/community?id=community_question&sys_id=3fd0375fdb2b3348fff8a345ca96...

 

 

Please mark reply as Correct/Helpful, if applicable. Thanks!

 

Regards,

Tushar