On-Call Assign (Assigned to based on Assignment Group) Script No Longer works in Istanbul

richelle_pivec
Mega Guru

I wonder if there is a better place for me to post my Istanbul upgrade-related questions?

Anyway, I have an On-Call Assign (Current) Business Rule that goes and looks at the on-call calendar for the Assignment Group in the Incident and then adds the person on-call to the Assigned to field. This worked fine in Fuji and now does not work in Istanbul. Any thoughts on what's different? We can still use "current," right?

Name: On-Call Assign (current)

Order: 1001

Run at Server

When to Run: After on Insert of Update

Condition: !current.assignment_group.nil() && current.assigned_to.nil()

Script:

//*****************************************************************************

// Assign unassigned incident to the current on-call person for the specified

// group.

//*****************************************************************************

onCallAssign();

function onCallAssign() {

    var userID;

    var userName;

   

    var rota = new OnCallRotation();

    rota.who(current.assignment_group);

    if (rota.next()) {

          // if this is a device notification, we can only assign if there is a primary user

          // there is no primary user if this is a manual rota, so just skip it in that case

          if (rota.getType() == 'device') {

                userID = rota.getPrimaryUser();

                userName = rota.getPrimaryUserName();

          } else {

                userID = rota.getUser();

                userName = rota.getUserName();

          }

         

          if (!userID) {

                return;

          }

         

          current.assigned_to = userID;

          current.update();

          gs.addInfoMessage("Automatically assigned to on-call: " + userName);

    }

}

1 ACCEPTED SOLUTION

dvp
Mega Sage
Mega Sage

can you try replacing line 13 with this rota.who(current.assignment_group.toString());


I remember someone posted with same kind of issue about a week or two ago


View solution in original post

2 REPLIES 2

dvp
Mega Sage
Mega Sage

can you try replacing line 13 with this rota.who(current.assignment_group.toString());


I remember someone posted with same kind of issue about a week or two ago


How wonderful! It worked!



thanks much,



Richelle