Skip to content

Commit f4edc41

Browse files
authored
Create README.md
1 parent c56ba8c commit f4edc41

File tree

1 file changed

+27
-0
lines changed
  • Core ServiceNow APIs/GlideAggregate/Incident resolution percentile by assignment group

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Incident resolution percentile by assignment group
2+
3+
## What this solves
4+
Leaders often ask for P50 or P90 of incident resolution time by assignment group. Out-of-box reports provide averages, but percentiles are more meaningful for skewed distributions. This utility computes configurable percentiles from incident resolution durations.
5+
6+
## Where to use
7+
- Script Include callable from Background Scripts, Scheduled Jobs, or Flow Actions
8+
- Example Background Script is included
9+
10+
## How it works
11+
- Uses `GlideAggregate` to get candidate groups with resolved incidents in a time window
12+
- For each group, queries resolved incidents ordered by resolution duration (ascending)
13+
- Picks percentile ranks (for example 0.5, 0.9) using nearest-rank method
14+
- Returns a simple object per group with count, average minutes, and requested percentiles
15+
16+
## Configure
17+
- `WINDOW_DAYS`: number of days to look back (default 30)
18+
- `GROUP_FIELD`: field to group by (default `assignment_group`)
19+
- Percentiles array (for example `[0.5, 0.9]`)
20+
21+
## References
22+
- GlideAggregate API
23+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/GlideAggregate/concept/c_GlideAggregateAPI.html
24+
- GlideRecord API
25+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/GlideRecord/concept/c_GlideRecordAPI.html
26+
- GlideDateTime API
27+
https://www.servicenow.com/docs/bundle/zurich-api-reference/page/app-store/dev_portal/API_reference/GlideDateTime/concept/c_GlideDateTimeAPI.html

0 commit comments

Comments
 (0)