The CreatorCon Call for Content is officially open! Get started here.

Need to create a Report related metrics definition

Mounika30
Kilo Sage

Hi ,

I need to create a report of incidents that are assigned to Service desk to other IT teams trending weekly.

how to achieve this?

13 REPLIES 13

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Mounika30 

 

 

https://www.servicenow.com/community/platform-analytics-forum/creating-a-report-using-metrics-table/...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

omkar_jadhav_
Tera Contributor

hi @Mounika30 
here are the steps that may help you

1. Create a Report:

  • Go to Reporting > Reports.
  • Click New.
  • Choose Report as the type.

2. Configure the Report:

  • Data Source: Select Incident table.
  • Title: Give the report a descriptive title, such as "Weekly Trend of Incidents Assigned to Service Desk."

3. Filters:

  • In the Filters section, add the following filters:
    • Assigned to: Choose "Service Desk" group (or the group representing your service desk).
    • Opened On: Add a relative filter to capture the last 52 weeks (Opened On >= Last 52 weeks). This ensures the report captures data for the past year.

4. Chart:

  • In the Chart section, choose Timeline as the chart type.
  • Group By: Select Opened On (Weekly). This will group and display data by week.

5. Values:

  • In the Values section, add a new value:
    • Field: Select "Assigned to group".
    • Function: Choose Count. This will count the number of incidents assigned to different groups for each week.

swathisarang98
Giga Sage

Hi @Mounika30 ,

 

Already OOTB box we have a metric definition with name 'Assignment Group'  you can use the same for reporting,

 

While reporting select table as Metric(metric_instance)

 

swathisarang98_0-1709722543155.png

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

AndersBGS
Tera Patron
Tera Patron

Hi @Mounika30 ,

 

Start by creating a metric definition according to below:

AndersBGS_0-1709722594912.png

NB! - remember to replace the sys_id in the script whit the sys_id of your assignment group "Service Desk"

// variables available
// current: GlideRecord -  target incident
// definition: GlideRecord -  (this row)
    if (current.assignment_group.sys_id == '97a2b0616fc331003b3c498f5d3ee437') {
        createMetric();
}

var assignment = current.assignment_group.DisplayValue;
function createMetric() {
  var mi = new MetricInstance(definition, current);
  var gr = mi.getNewRecord();
  gr.field_value = current.assignment_group;
  gr.start = current.sys_updated_on;
  gr.calculation_complete = true;
  gr.insert();
}

Next, create a report based on below:

 

AndersBGS_2-1709722850807.png

Create the report condition as below - again, remember to change the "services support" to "your assignment group name":

AndersBGS_3-1709723080323.png

 

This will give you the following report:

 

AndersBGS_4-1709723113650.png

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

best regards

Anders

 

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/