How to configure an OLA dynamically when the Assignment Group changes on a Case?

Sathwik1
Tera Guru
I need to configure an OLA on the Case table that starts whenever the Assignment Group changes from one group to another (e.g., Group A → Group B), but should not trigger during the initial assignment (Empty → Group A).

How to add this condition? as I don't see "changes" operator doesn't exist in SLA Definition table.

@Ankur Bawiskar @Tanushree Maiti pls help

3 REPLIES 3

Tanushree Maiti
Tera Patron

Hi @Sathwik1 

 

Out of the box (OOB), ServiceNow does not provide a Changes operator in the SLA Definition conditions.

I believe this requirement can be achieved through customization.

Proposed approach:

  1. Create a custom field on the Case table, for example, u_reassignment_cnt.
  2. Create a Business Rule (BR) that triggers whenever the Assignment Group is updated on a Case record. increment u_reassignment_cnt by 1 each time when the reassignment occurs.
  3. Create an OLA with the following start conditions:
    • u_reassignment_cnt is not 0.
    • Assignment Group is <your specified assignment group>.

Note: you can update start condition as per your requirement.

 

This way, the OLA will start when the Case is reassigned to the specified Assignment Group.

 

kvivek707
Giga Contributor

Here are the flow you can try this 

Create a custom Boolean field on Case

Navigate to System Definition → Tables → Case [sn_customerservice_case].

Create a field:

  • Label: Group Reassigned

  • Column name: u_group_reassigned

  • Type: True/False

  • Default: False

Here are the flow you can try this 


Case created
|
Assignment Group = Empty
|
Initial assignment: Empty -> Group A
|
Business Rule checks previous value
|
Previous value is empty
|
Group Reassigned = False
|
OLA does not start

----------------------------

Assignment Group: Group A -> Group B
|
Business Rule checks previous value
|
Previous value is not empty
|
Group Reassigned = True
|
OLA Start Condition matches
|
Task SLA created
|
Reset Group Reassigned = False

Aditya_hublikar
Giga Sage

Hello @Sathwik1 ,

 

As per your question you have to reset ola ( when new assignment group is assigned then cancel previous ola and attach new ola ) when assignment group changes , except first assignment group assigned ?

 

If yes then you need 2 fields  to validate assignment group change and to reset ola .

 

I tried this on my pdi for sla with incident form . created 2 fields type Boolean : sla initial and sla terminate .

Created one business rule : before update ( incident table )

(function executeRule(current, previous) {

    if (current.assignment_group.changes()) {

        //initial assigmen grp assigned  = A
        if (previous.assignment_group.nil() &&
            !current.assignment_group.nil()) {

            current.u_sla_initial = true;
            current.u_sla_terminate = false;

        }

        // when assignment grp changes A => B
        else if (!previous.assignment_group.nil() &&
                 !current.assignment_group.nil()) {

            current.u_sla_initial = true;
            current.u_sla_terminate = true;

        }

    } else {
        current.u_sla_terminate = false;
    }

})(current, previous);

 

Created sla :

Aditya_hublikar_0-1795078573575.png

 

Aditya_hublikar_1-1795078657659.pngAditya_hublikar_3-1795078843622.png

 

Aditya_hublikar_2-1795078721460.png

 

 

If this helps you then mark it as helpful and accept as solution .

Regards,
Aditya