Display the number of times assignment group changes in the incident record

keerthana
Tera Contributor

using script

5 REPLIES 5

Harish Bainsla
Kilo Patron
Kilo Patron

Create BR

var currentAssignmentGroup = current.getValue(assignmentGroupField);
var previousAssignmentGroup = previous.getValue(assignmentGroupField);

if (!current.getValue(changeCounterField)) {
current.setValue(changeCounterField, 0);
}
if (currentAssignmentGroup != previousAssignmentGroup) {
var changeCounter = current.getValue(changeCounterField);
current.setValue(changeCounterField, changeCounter + 1);
}

didn't get answer

AndersBGS
Tera Patron
Tera Patron

Hi @keerthana ,

 

You have an OOTB value called reassignment count on the incident record which can be utilized.

 

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/

Koen Spiessens
Tera Contributor
// Create a GlideRecord query on the incident table
var incidentGr = new GlideRecord('incident');
incidentGr.addQuery('active', true); // Choose filter to filter incidents
incidentGr.query();

while (incidentGr.next()) {
    var reassignment_count = incidentGr.reassignment_count;
    gs.log("reassignment count: "+reassignment_count);
}