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.

time count

adilalee
Tera Contributor

adilaleepan_0-1762444652877.pngadilaleepan_1-1762444657536.png

i want to count time in particular state choice label inmaintaince | value is 3

 

3 REPLIES 3

ReginaldFawcett
Tera Guru

I would suggest using Metrics to do this instead of a Business Rule. With Metrics Definitions [metric_definition] you can set the type to "Field value duration", and the field to whatever field you are looking at.
The results are found on the Metric [metric_instance] table.
It will save you a lot of time and frustration with the calculations.

Metric Definition

ReginaldFawcett_1-1762545043505.png

Metric

 

ReginaldFawcett_0-1762545017636.png

 

 

adilalee_0-1762586441773.pngadilalee_1-1762586462913.png

adilalee_2-1762586485150.png

 i want to calculate duration of every record that state is in maintaince or Value is 3 now tell me it is possible from here if yes then guide me and i accept your solution

 

it doesnot work