Incident reassignment: auto state change + mandatory work notes (multiple conditions)

nameisnani
Mega Sage

Hello Community,

We have the following requirements on the Incident table and are looking for the best practice approach.


Requirement 1

  • When an Incident is reassigned to another assignment group (queue)

  • AND the current state is On Hold

  • The state should automatically move to In Progress

  • Work notes must be mandatory during this reassignment


Requirement 2

  • When an Incident is reassigned to another assignment group (queue)

  • Irrespective of the current state

  • Work notes must always be mandatory

nameisnani_0-1770187455254.png

 

 

 

I have used this Before update BR - is there in any issue in mu BR 

 

What is the recommended approach to handle both requirements together?

 

can anyone please help me with this requriment . 

 

please provide us script

6 REPLIES 6

@Ankur Bawiskar  sure i will test and update you 

nityabans27
Mega Patron

Hi,

Use ONE Before-Update Business Rule on Incident.

Logic:

  1. Run only when assignment_group changes

  2. Always require work notes (all states)

  3. If previous state = On Hold → set state = In Progress


✔ Business Rule Script (final)

(function executeRule(current, previous) {

    // Run only on reassignment
    if (!current.assignment_group.changes()) {
        return;
    }

    // Work notes mandatory
    if (!current.work_notes.toString().trim()) {
        gs.addErrorMessage('Work notes are mandatory when reassigning an incident.');
        current.setAbortAction(true);
        return;
    }

    // If was On Hold, move to In Progress
    if (previous.state == 3) { // On Hold
        current.state = 2;     // In Progress
    }

})(current, previous);

✔ Why this works

  • Covers both requirements together

  • Works for UI, API, email, integrations

  • No duplicate rules, no UI-policy gaps

This is the correct production approach.