Metric definition for sys_updated_by

ddhaene
Kilo Contributor

I can't figure out why the metric does not create an instance if I am "watching" sys_updated_by or sys_mod_count. Has anyone else had a problem like that?

 

I have one metric definition that is a script calculation and another setup as a field value duration. I tried using sys_updated_by in the field value calculation and didn't "catch" anything. I also tried using sys_mod_count in the field value calculation and got no love.

That makes me wonder if these fields are really eligible for this kind activity. I looked at the "First Call Resolution" metric definition. It uses if (current.sys_mod_count == 0) { in the script and that seems to work no problem. That makes me wonder if I even have a clue how metrics really work. I have read and followed the wiki article

Metric Definition Support - ServiceNow Wiki

 

Ultimately, I am trying to get a count of tickets that the Service Desk folks "handle" without getting credit. We can run reports on sys_updated_by but that doesn't help if the ticket has been worked and closed by someone else. So, I'm thinking a metric would help me capture this information as it changes.

 

Any ideas? Any comments?

12 REPLIES 12

Inactive
Mega Expert

If I understand correctly, you are trying to track all the tickets your Service Desk works on, even if they don't initiate/close the ticket?


ddhaene
Kilo Contributor

Yes. That's right. We have a few inbound email actions that create tickets, but those tickets are not assigned (or not assigned properly), so they end up with the Service Desk. The Service Desk folks didn't create the ticket and they probably won't work the ticket, but they have to consider it for a short while anyway.



I am trying to get a count of those tickets (and tickets like those).


Metrics definitions get triggered everytime a ticket is inserted / updated. Now in your case, you need not write any condition on sys_updated_by. Whenever a ticket will be updated, your metric definition will automtically be called. You can just create the metric instance in the script. Can you share your code?


srinivasthelu
Tera Guru

No watching on those fields(OOB).if at all you need to do this, you need trigger event from BR on every insert or update by this way.



gs.eventQueue('metric.update', current, '[sys_updated_by]',1, 'metric_update');