sla calculation from when assignment group changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 12:22 AM
I want to create a report on incident table to calculate the resolution time of a ticket but not from the start time, from the time the ticket is assigned to another group( once the assignment group changes) .?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 01:19 AM
Hi @gayatri38 ,
Why don't you just change the SLA definition to restart the moment the group is reassigned? Note that this could mean that your SLA never ends, if it starts getting reassigned constantly though.
You can do this in the SLA definition record -> Reset condition. More in this article.
Alternatively, you can achieve what you need probably with a few scripts and a custom field in the incident table. Here is a sample script:
1. Business rule on incident table:
(function executeRule(current, previous /*null when async*/) {
if (current.assignment_group != previous.assignment_group) {
current.u_reassignment_time = new GlideDateTime();
}
})(current, previous);
2. Business rule on incident table:
(function executeRule(current, previous /*null when async*/) {
if (current.state == 'resolved' || current.state == 'closed') {
var reassignmentTime = new GlideDateTime(current.u_reassignment_time);
var resolutionTime = new GlideDateTime(current.closed_at);
var duration = GlideDateTime.subtract(reassignmentTime, resolutionTime);
current.u_resolution_duration = duration.getDurationValue();
}
})(current, previous);
Note that you might have to adjust the scripts, if you decide to go this way. To apply the duration to the custom fields for already existing incidents, it might be hard to do. You can find any past changes in the sys_history_set table, then you can calculate from there, for a specific record, when the group was reassigned, and when was the ticket closed to get the duration. This will be in the audit log.
I hope you find this information helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 01:20 AM
Hi @gayatri38
You could use start condition reassignment_count != 0
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2023 02:26 AM
Hi @gayatri38 ,
Why not utilizing the incident_metric table for assignment group. Based on this, you have the actual start time for when the incident was assigned to specific group and when the incident is resolved. Based on these two values, you can do the calculation.
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/