Approval for Change sent to assignment group of change task

Sam Ogden
Tera Guru

Hi All,

Currently on our Normal change workflow we send out a peer review approval.   This is sent to the primary group of the person who the log is request by.

Out change manager wants to change this step of approval.   They would like the group approval to be sent to the assignment group of each change task.

How would we achieve this?

Thanks

Sam

1 ACCEPTED SOLUTION

Youre getting the same sys_id x number of time due to the way javascript works behind the scenes here...



Try using the following which should get you the unique sys_id for each group.



gr.getValue('assignment_group');


View solution in original post

6 REPLIES 6

Niklas Peterson
Mega Sage
Mega Sage

Hi Sam,



Has the Change tasks been created and assigned to groups at the point where you want to send out the approvals? Then you can create a script to loop all tasks related to the change record and fetch the assignment groups from the tasks.



Regards,


Niklas


Hi Nicklas  




Thanks for the above, all tasks would be created and assigned to groups before the approvals would be requested.




Do you have an example script?  


Thanks


Sam Ogden
Tera Guru

Hi All,



I've attempted to create a script in the group approval, but I am only getting an approval for the last group from the script.   As can see below 'Server team' is the last group in my log statement.   This is the only group I am getting an approval for.   As their are 3 tasks on the change request I want   each assignment group to be sent a group approval I.e. Strata Services, Server Team & Web Services Project.   I'm guessing that my array is only being populated with the last result, fairly new to coding so not sure where I have gone wrong on the Below :



Scirpt


find_real_file.png


Log Statement Results


find_real_file.png


Approval being set


find_real_file.png


tasks on the change request before being sent for the approval


find_real_file.png


Realised I was setting my answer variable in the loop, amended this but it is still not working.


Seems to be overwriting the sysId in the array each time so it ends up with the final group sysID in the array 3 times.


Script currently:



find_real_file.png