Related to ITSM

JAYESH KUMAR YA
Tera Contributor

How can we achieve the below scenario

Any member of the particular assignment group should be able to assign the task to themselves or any other member of the existing group including the group manager

1 REPLY 1

Tushar
Kilo Sage
Kilo Sage

Hi @JAYESH KUMAR YA 

 

I think you can implement this using a BR -

 

(function executeRule(current, previous /*null when async*/) {
  // Get the assignment group for this task.
  var assignmentGroup = current.assignment_group;

  // Get the current user's ID.
  var currentUserID = gs.getUserID();

  // Check if the current user is a member of the assignment group or a group manager.
  var isMember = gs.hasRole('Assignment Group Members');
  var isManager = gs.hasRole('Assignment Group Managers');

  // Set the assignment group and assigned to fields.
  if (isMember && (current.assigned_to == currentUserID || isManager)) {
    current.assignment_group = assignmentGroup;
    current.assigned_to = currentUserID;
  }
})(current, previous /*null when async*/);

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar