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

Michael Fry1
Kilo Patron

Since RITM is extended from Task table, you can create a Metric on the RITM table, and check Timeline which will measure how long in each state. You can then report on the Metric instance table with condition Definition is x, where x is the name of your definition.



Screen Shot 2016-07-21 at 5.18.33 PM.png


Thank you for the information Michael. I created a Metric Definition on the sc_req_item table and checked Timeline.



Then created a report but no data is displayed.



This seems like the right way to go but I must be missing something. Any suggestions would be helpful.


Susan


The Metric will start on newly created tickets, not tickets in the past. Try creating a new ticket and see if a metric instance is created.


Sorry, your report should be on the incident_metric table, not metric_instances.