tkh
Kilo Expert

I am not sure if this is the proper place to put this information out there,but I know I look for this information for a while so I wanted to make it available for any one else who may be interested.  So please forgive me if this isn't the right place for it.   

Our Change Management policy requires that an change approval be obtained from every team that will be participating in the implementation of a change.  Makes sense right, if you are going to be implementing the steps you should approve them.  Since we use Implementation Change Tasks to track who will be do the change implementation and in what order, that means we need an approval from every team assigned an Implementation Change Task.  But getting those approval into the Change Approval in any kind of automated fashion is no simple feat, and usually the change owner ends up adding the approval teams manually.

While searching to a solution to this problem I found most solutions involved adding a approval workflow to the change task table but that wasn't really the direction I wanted to go.  I did find however, a script that could be used with the Group Approval workflow widget to loop through the Affected CI related list and add the Approval Group from the Affected CI Approval Group field on the CI records.  I asked myself, if it worked for one related list, why couldn't I do something similar for another related list?  So using the Affected CI script as my template, and a lot of trial and error, I came up with the script below to use a GlideRecord to grab the active Change Tasks, that matched the current change Requests, and had the type of Implementation. Then I loop through them and pushed either the Assignment Group, or the Approval Group field (I have a line for both you can choose which one works for your circumstance) to the Approval Group list on the Change Request.

Here is the script, please use as you like.

var answer = [];

var ctask = new GlideRecord('change_task');
ctask.addActiveQuery();   //Limits look up to active records
ctask.addQuery('change_request', current.sys_id);  //limits records to look up to those matching current change request
ctask.addQuery('change_task_type','implementation');   //limits look up further to only implementation type
ctask.query();
while (ctask.next()) {
answer.push(ctask.assignment_group.sys_id); //pushes from assignment group field 
//answer.push(ctask.u_ctaks_aprvl.sys_id); //pushes from approval group field
}

 

 

Version history
Last update:
‎03-12-2020 12:48 PM
Updated by: