How to view any tickets updated (at any time) by an individual

Manisha30
Tera Guru

Hi All,

 

We have a requirement where we are trying to view tickets updated by an individual at any point in the month. Currently, the 'updated by' function only shows who the last person the ticket has been updated by. Is there any other way to view this? This is to give my team an overall view of all tickets worked on by an individual.

 

Can someone provide your expertise over here?

 

Thank you in Advance!!!
Manisha

4 REPLIES 4

Allen Andreas
Administrator
Administrator

Hi,

Out of box there is no report to do this. You'd have to consider creating a metric for to track this.

For performance analytics, this post is within the HRSD section of the forums, so I don't think the free ITSM PA will help you.

 

For viewing the history of the record, that isn't a report and would have to be done as a one off to check and see who touched it.

 

For reporting off of the audit/history table, it's not leading practice to enable reporting for that table due to the performance impact on the instance as when you enable that table for reporting, unless you restrict it elsewhere, everyone else could also report against it.

 

Overall, if you create a metric for the HR case table, for example, you can capture who has updated the case and then you can build your report on this HR case metric table accordingly.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Community Alums
Not applicable

There is performance analytics where you trend ticket data over time and view who updated the tickets during this time as a breakdown. There are limited performance analytics for ITSM that are free if you wanted to explore that route.

 

You could also view the history of the record to view who updated the ticket over the course of its creation. There's also the option of reporting off this sys audit history table but you'll need to enable it to be reportable via system property. You'll also need to apply enough filters so that performance isn't impacted when you try to report off this table.

 

These are just some other options.

Narsing1
Mega Sage

Hi,

There may not be a straight forward way to achieve this requirement, but there is a possibility that you can think of using  History Walker API .  (Or) Audit Table

For doing this,

  • you need to consider to create a custom table / may be a custom app and inside that a table (If you are not supposed to create a custom table due to your subscription). 
  • Run the scheduled job using History walker either on demand / on a weekly basis as this would take much time to get the results.
  • Use some conditions to limit your records in gliderecord ex: can take all incidents that are work in progress

Here is an example.  Incident created by someone else and admin updated the incident.  When you use the History Walker, it gives you the results something like this.

 

var grincident = new GlideRecord("incident");
grincident.addQuery("number", "INC0010001");
grincident.query();
if (grincident.next()) {
	try {
		var hw = new sn_hw.HistoryWalker(grincident.getTableName(), grincident.getUniqueValue());
        hw.walkTo(0);
		do {
			var walkedGr = hw.getWalkedRecord();
			var dt = new GlideDate();
			dt.setValue(walkedGr.sys_updated_on);
			if (dt.getMonthNoTZ() == 7 && dt.getYearNoTZ() == 2024) { //You may change the month and year as per your requirement
				gs.print(walkedGr.sys_updated_by + " updated on " + walkedGr.sys_updated_on);
			}
		} while (hw.walkForward());
	} catch (e) {

	}
}

 

Result

Narsing1_0-1722149288475.png

Note:  You may try with Metric definition, but that doesn't work for "Updated By" field.  I think for your requirement the field is independent I believe.  User may update any field and you want to capture who updated.

 

Thanks,

Narsing

 

Satishkumar B
Giga Sage
Giga Sage

Hi @Manisha30 

To achieve a view of all tickets that have been worked on or updated by an individual at any point in time, you can leverage the "Audit" feature in ServiceNow. The audit functionality tracks changes to records, including who made the changes and when. Here's how you can set up a solution to view all tickets updated by a particular user throughout the month:

Solution Overview

  1. Enable Auditing: Ensure that auditing is enabled for the tables you are interested in, such as the incident or task table.
  2. Query the Audit Log: Use the sys_audit table to retrieve records based on the user and the timeframe.
  3. Create a Report: Build a report or a dashboard to display the information in a user-friendly manner.

Refer below KB article for Audit enabling:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0723730

Sample Query Script for Audit Log for reference:

 

 

var userSysId = 'USER_SYS_ID'; // Replace with the user's sys_id
var startDate = gs.beginningOfThisMonth(); // Start date of the month
var endDate = gs.endOfThisMonth(); // End date of the month

var auditGR = new GlideRecord('sys_audit');
auditGR.addQuery('user', userSysId);
auditGR.addQuery('sys_updated_on', '>=', startDate);
auditGR.addQuery('sys_updated_on', '<=', endDate);
auditGR.query();

var updatedTickets = [];
while (auditGR.next()) {
    if (updatedTickets.indexOf(auditGR.documentkey.toString()) === -1) {
        updatedTickets.push(auditGR.documentkey.toString());
    }
}

gs.print('Tickets updated by the user: ' + updatedTickets.join(', '));

 

 

 

……………………………………………………………………………………………………
HAPPY LEARNING 🙂

Please Mark it helpful 👍 and Accept Solution ✔️ !! If this helps you!!