Keeping Track: Creating Effective Incident Aging Reports in ServiceNow
- nathanlee142
- Mar 21
- 4 min read
Updated: Mar 28

In the fast-paced world of IT service management, staying on top of incidents is crucial. Knowing how long incidents have been open, often referred to as incident aging, is vital for identifying potential bottlenecks, ensuring timely resolutions, and maintaining service level agreements (SLAs). ServiceNow offers powerful reporting capabilities to visualize and analyze this data. This article will guide you through the process of creating a comprehensive incident aging report in ServiceNow, presented in a clear, tabular format similar to a pivot table, allowing for insightful analysis of your incident lifecycle.
Understanding how long incidents remain open is key to improving your IT support processes. An incident aging report provides a clear overview of the backlog and helps identify incidents that might require attention. Let's explore a robust method to configure such a report in your ServiceNow instance.
Step-by-Step Guide to Building Your Incident Aging Report
To create an effective incident aging report in a tabular format, we will follow these steps:
Create an 'Aging category' Choice Field on the Incident Table:
To categorize incidents based on their age, we first need a dedicated field.
Navigate to System Definition > Tables.
Search for and open the Incident table.
Under the Columns tab, click New.
Enter the following details:
Column name: u_aging_category (the u_ prefix indicates a custom field)
Type: Choice
Label: Aging category
Click Submit.
Configure Choices for the 'Aging category' Field:
Now, we'll define the different aging buckets as choices for this field.
Navigate to an Incident form.
Right-click on the label of the newly created Aging category field.
Select Configure Choices.
Add the following choices exactly as written (the order might not matter initially):
3-7 Days
8-14 Days
15-21 Days
22-28 Days
28 Days
Click Save.
Schedule a Job to Automatically Update Incident Aging Categories:
To keep the aging categories up-to-date, we will create a scheduled job that runs a script to calculate the age of each open incident and assign the appropriate category.
Navigate to System Definition > Scheduled Jobs.
Click New.
Select Automatically run a script of your choosing.
Provide a meaningful name for the job, such as "Update Incident Aging Categories".
Set the Run field to an appropriate frequency, such as "Daily" (you can adjust this based on your reporting needs).
In the Script field, paste the following code:
JavaScript
u_updateIncidentAging();
function u_updateIncidentAging() {
var elapsedTime = 0; var aging = '';
var currentTimeNow = gs.nowDateTime();
var gr = new GlideRecord('incident');
gr.addEncodedQuery('active=true^u_aging_categoryISEMPTY^ORactive=true
^u_aging_category!=>28');
// Only process active incidents without an aging category
//or those not in the '> 28 Days' category
gr.query();
while(gr.next()) {
elapsedTime = (gs.dateDiff(gr.opened_at, currentTimeNow,
true))/(60 * 60 * 24);
// Check to see when the incident was created
if (elapsedTime <= 2) aging = '0-2 Days';
if (elapsedTime > 2 && elapsedTime <= 7) aging = '3-7 Days';
if (elapsedTime > 7 && elapsedTime <= 14) aging = '8-14
Days';
if (elapsedTime > 14 && elapsedTime <= 21) aging = '15-21
Days';
if (elapsedTime > 21 && elapsedTime <= 28) aging = '22-28
Days';
if (elapsedTime > 28) aging = '> 28 Days';
// Skip any Business Rules to avoid potential loops
gr.setWorkflow(false);
// Prevent updating system fields like 'sys_updated_on'
gr.autoSysFields(false);
gr.u_aging_category = aging;
gr.update();
}
}
Click Submit.
You can click the Execute Now button on the scheduled job to run the script immediately and populate the 'Aging category' field for existing incidents.
Create the Incident Aging Report:
Now that we have the data categorized, we can build the report.
Navigate to Reports > Create New.
Provide a Title for your report, such as "Incident Aging Report".
Select the Source type as Table and choose the Incident table.
Click Next.
Choose the Type of report as Pivot Table.
Under the Rows section, select Aging category.
Under the Columns section, you might want to select another relevant field for further analysis, such as Assignment group or Priority. If you only want the aging breakdown, you can leave this empty.
Under the Aggregation section, select Count.
You can add filters in the Filter section to refine your report (e.g., Active is true to only see open incidents).
Click Save and then Run to view your report. You should see a tabular report showing the count of incidents in each aging category, potentially broken down by your chosen column field.
Alternative: Using a Bar Chart Grouped by Created Date
While the above method provides a tabular format, you can also get a visual representation of incident aging by creating a bar chart. In this approach:
Create a new report on the Incident table.
Choose the Type as Bar.
In the Group by field, select Created. You can then choose a date grouping, such as "Weeks" or "Months," to see the trend of when incidents were created.
You can add filters to focus on open incidents or specific timeframes.
This method offers a quick visual overview but doesn't categorize incidents into specific aging buckets as precisely as the choice field and scheduled job approach.
Conclusion
Creating an incident aging report in ServiceNow allows you to gain valuable insights into your incident management process. By following the steps outlined in this article, you can build a clear and informative tabular report that categorizes incidents based on their age. This report will empower you to identify trends, address bottlenecks, and ultimately improve your IT service delivery. As a next step, try configuring this report in your ServiceNow environment. Experiment with different column groupings and filters to tailor the report to your specific needs and gain a deeper understanding of your incident lifecycle. Regularly reviewing this report will help you proactively manage incidents and ensure timely resolution for your users.