To create a pa widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2023 11:30 PM
To create a widget to get the count of the tickets which is not updated from last 4 days which also should exclude the weekends.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2023 11:59 PM
Hi @lg19 ,
Which type of tickets do you refer to in your requirement? Incidents, requests etc.?
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/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2023 12:07 AM
Incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2023 12:15 AM
Hi @lg19 ,
Ok, according to your requirement to exclude weekends, I don't see any option to do it straight through the build in condition builder in the report designer or Performance Analytics. Instead I would think that you need to create a scripted indicator to capture the data. for How the script should be, I will unfortunately not be able to say.
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/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2023 02:29 AM
Hi @lg19
You can leverage the Metric Definition and Metric Instance as the storage of these tickets (not updated 4 days excluded weekends).
1. Create Metric Definition with type Script Calculation.
2. Create Scheduled Job run on Daily.
Sample below.
var metricDefinition = '35de8adac0a808ae0027b623851e22f1'; //Replace to your Metric Definition
var grIncident = new GlideRecord('incident');
grIncident.addActiveQuery(); //replace to your query
grIncident.query();
while(grIncident.next()){
var gdtCreated = new GlideDateTime(grIncident.sys_updated_on);
var gdtToday = new GlideDateTime();
var schedule = new GlideSchedule();
schedule.load('ded21b2047d27910ab9bb6bf016d43a0'); //24x5 Schedule
var duration = schedule.duration(gdtCreated, gdtToday);
var days = duration.getDayPart();
if(days >= 4){
createMetric(metricDefinition, grIncident);
}
}
function createMetric(definition, record) {
var mi = new MetricInstance(definition, record);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.field_value = true;
gr.calculation_complete = true;
gr.insert();
}
3. Create your Reports or Indicator Source (PA) on the Metric Instance [metric_instance] table.
Let me know if it works for you.
Cheers,
Tai Vu