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.

Request Item metrics from Open to Approve to Close

sfoleygo
Kilo Explorer

I'm looking for an example of setting up a Request Item SLA to track duration from Open to Approve and Approve to Close. I tried creating a single SLA definition on the sc_req_item table with conditions:

Start Condition: State is Open

Stop Condition: State is not one of Closed Complete, Closed Incomplete or Cancelled

Pause Condition: Approval is Requested

I wanted to use 'Stage' rather than 'State' in the conditions only shows 'catalog item removed' as the only option. (this may be a whole other issue as that's the only option for stage when building workflows as well)

I also tried creating a Metrics business rule on the sysapproval_approver table with the following script:

var gru =   new GlideScriptRecordUtil.get(current)

var fieldsChanged = gru.getChangedFieldNames();

gs.eventQueue('metric.update', current, fieldsChanged.toString(), current.sys_mod_count, 'metric_update');

...but I need a next step to test this.

Thanks,

Susan

6 REPLIES 6

jmcagod
Kilo Guru

Hi Susan,



Did you find the solution for this? I am having the same situation,


Thanks!


PhilipN
Tera Contributor

You should be able to find the metrics under the table sc_req_item_metric