How to Calculate time between case creation and case assignation to agent?

Pallavi pawar
Tera Contributor

Hello All,

 

How to Calculate time between case(HR Case) creation and case assignation to agent?

I want Average amount of time between case creation and case assignment. 

 

How to calculate this time?

 

Please Help!!

Thank You!!

1 ACCEPTED SOLUTION

Hi,

It seems that you are asking me to provide a solution to a task or assignment. The given formula is used to calculate the time difference between two dates, in this case, the difference between the "opened_at" and "assigned_to" fields in ServiceNow.

To add a formula field to a report, follow these steps:

  1. Navigate to the report that you want to add the formula field to.

  2. Click the "Edit" button to enter report editing mode.

  3. Click the "Add Field" button to add a new field to the report.

  4. In the "Field Type" dropdown, select "Formula".

  5. Give the field a name, such as "Time to Assign".

  6. In the "Formula" field, enter the following script:

    gs.dateDiff(gs.dateFromFormat(current.opened_at, 'yyyy-MM-dd HH:mm:ss'), gs.dateFromFormat(current.assigned_to, 'yyyy-MM-dd HH:mm:ss'), true)

  7. Click "Save" to save the field and exit report editing mode.

Once you have added the formula field, it should display the time difference between the "opened_at" and "assigned_to" fields in the report.

 

Thanks,

Rahul kumar

If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar

View solution in original post

6 REPLIES 6

sushantmalsure
Mega Sage
Mega Sage

You can think of defining your own metric definition for this.

May be of type 'Field value duration' where you can check the time between state = new to state = assigned Or something similar on HR case to see time duration between these 2 events.

More details: 

https://docs.servicenow.com/bundle/utah-platform-administration/page/use/reporting/task/create-metri...

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

and once you have metric definition then you can create report on that metric definition and see what ever you want like average etc..

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Rahul Kumar17
Tera Guru

Hi @Pallavi pawar ,

 

To calculate the time between case creation and case assignment in ServiceNow, you can use a script or create a report with the following steps:

  1. Create a new report: Navigate to the "Reports" module and create a new report. Select the "HR Cases" table as the source table.

  2. Add columns: Add the "Opened at" and "Assigned to" fields to your report.

  3. Add a formula field: Add a new field to your report and select "Formula" as the field type. Name the field "Time to Assign" or similar. In the formula editor, enter the following script:

gs.dateDiff(gs.dateFromFormat(current.opened_at, 'yyyy-MM-dd HH:mm:ss'), gs.dateFromFormat(current.assigned_to, 'yyyy-MM-dd HH:mm:ss'), true)

This script will calculate the time difference between the "Opened at" and "Assigned to" fields in hours.

  1. Set filter conditions: Set filter conditions to only include cases that have been assigned to an agent. You can use the condition "Assigned to is not empty".

  2. Group and summarize: Group your report by "Opened at" and summarize the "Time to Assign" field using the average function.

  3. Run the report: Run the report to see the average time between case creation and case assignment.

This report will give you the average amount of time between case creation and case assignment for HR cases in ServiceNow.

 
Thanks,
Rahul Kumar
If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar

Thanks Rahul for reply,

But not getting 3rd step-

i.e.  Add a formula field: Add a new field to your report and select "Formula" as the field type. Name the field "Time to Assign" or similar. In the formula editor, enter the following script:

gs.dateDiff(gs.dateFromFormat(current.opened_at, 'yyyy-MM-dd HH:mm:ss'), gs.dateFromFormat(current.assigned_to, 'yyyy-MM-dd HH:mm:ss'), true)

 

Pallavipawar_0-1681981950314.png