Add additional assignee list in change request

Nani3
Kilo Contributor

Hi experts,

When a change task is created under a change request, then the assigned to from the change task should be populated in the parent change request in additional assignee list.

If multiple change tasks were created under change request all the assigned to users of change tasks should comes in additional assignee list whenever the change task is updated/inserted.

Please help ASAP 

looping @Ankur Bawiskar @Chuck Tomasi  @Allen Andreas 

Thanks in advance!

7 REPLIES 7

Hi Ankur.,

I have tried with what abhijit provied, still there is error,

 

AS 

If there are 20 tasks it gets added with 20 additional assignee, can you look into once let me know ASAP..

 Can you please look into it and let me know if there are any changes required.,

Hi,

In else part use below logic:

var grChange = new GlideRecord('change_request');
if(grChange.get(current.change_request)){
if(JSUtil.nil(grChange.additional_assignee_list)){
   grChange.additional_assignee_list = current.assigned_to.toString();
}else{
   var arrayUtil = new global.ArrayUtil();
   var assigneeList = grChange.additional_assignee_list.toString() +','+ 
   current.assigned_to.toString();
   var arr = arrayUtil.unique(assigneeList);
   grChange.additional_assignee_list = arr.toString();
}
grChange.setWorkflow(false);
grChange.update();

 

Note: Please correct if any typo error.

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Please refer the corrected script, have modified the script :

var grChange = new GlideRecord('change_request');
if(grChange.get(current.change_request)){
if(JSUtil.nil(grChange.additional_assignee_list)){
   grChange.additional_assignee_list = current.assigned_to.toString();
}else{
   var arrayUtil = new global.ArrayUtil();
   var assigneeList = grChange.additional_assignee_list.toString() +','+ 
   current.assigned_to.toString();
   var arr = arrayUtil.unique(assigneeList);
   grChange.additional_assignee_list = arr.toString();
}
grChange.setWorkflow(false);
grChange.update();

 

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande