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.

Can I use the function field to capture time & date when status changes?

JLeong
Mega Sage

Hi Guys,

 

How can I create a report to show a time & date when an incident changes from "Pending" to "Work in Progress".

Could I use the function field in the report? I am not sure how?

 

Thanks in advance.

 

 

2 ACCEPTED SOLUTIONS

John Dahl
Kilo Sage

I would not go down the function field route... even if it works as expected, it might get more complicated than necessary. Since a record can get into the "Pending" state multiple times and for various reasons, you will want to determine if you want to track the first time, the last time, or any particular conditions that were active when the state change occurred. Two options that will give you precise control to track only the value you need are listed below:

  • You can create a metric on the table that will tell you when the state changed and you can report on that.
  • You can just create a simple date field that is set by a business rule or flow when the state changes.

Either of the options above should work and might provide a means that you and your team are already familiar with. 

View solution in original post

The start and end will be important for metrics where you want to track the duration in which a record was in a specific state (i.e. Pending). If your concern is something different and you don't care how long a record was in the pending state, then you can use a scripted metric. This gives you a lot of flexibility to look at the record values to determine if the current change is the one you want to track. For example, maybe you only want to know when the record changes to WIP after an attachment has been added to the record. A script can enable you to check for an attachment, and if found, set the metric calculate accordingly.

 

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

View solution in original post

7 REPLIES 7

Thanks, John! I will go with creating a metric. So how do I determine the Start and the End Date?

- Start Date when the State changes to Pending

- End Date is when the State changes to Work in Progress

 

Thanks!!!

The start and end will be important for metrics where you want to track the duration in which a record was in a specific state (i.e. Pending). If your concern is something different and you don't care how long a record was in the pending state, then you can use a scripted metric. This gives you a lot of flexibility to look at the record values to determine if the current change is the one you want to track. For example, maybe you only want to know when the record changes to WIP after an attachment has been added to the record. A script can enable you to check for an attachment, and if found, set the metric calculate accordingly.

 

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

Thanks John! You've been very helpful!