Change CIs approvals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014 12:13 PM
I have a requirement where on a change workflow i need to add approvals from the affected CIs added to the request.
I have created a new field called 'Change Approvers' on the cmdb_ci table which is a glide list and refers to the user table (not group). So I query the affected CI table and query the CIs of the change request and push them as individual approvers into one activity.
The approval activity waits for each approver to approve.
But i need to by pass (put other approval to 'no longer required') the approval even if one from the list approves for that CI but still wait for the other CI change approval list approvers to approve.
(Basically when one from the 'change approver' list of CI approves the other users in that CI 'change approver' list should become no longer required but the Approval list of the other affected CI should still be requested)
i have attached the script and the field screen shot for more clarity.
Please help me as soon as possible. Any work around would help. let me know if more additional information is required.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2014 06:58 AM
i had a similiar issue with Server Decom... needed to get one approval from every application but only needed one approver from each application....
what i did was feed all of the apps into an array <you could do the same with the affected ci's and stored that array into a workflow variable...
then i made a series of if's in the workflow where if array.length => 1 <change this to count up through the number of applications>
if it passes the if statement it goes to an approval that sends an approval to the approvers for the app... if it fails it goes to a join after the approval.
the only problem with this is it isn't really dynamic.. you have to set a maximum number of items you will approve for <I setup ten approvals>
this is the script for the if statement...
answer = ifScript();
function ifScript() {
if (workflow.scratchpad.apprvr_ary.length >= 4) {
return 'yes';
}
return 'no';
}
___________________________
so in effect you have a script to feed the ci's into an array... then a branch... the branch goes to ten if statements...yes on those goes to an approval and no goes to the join immediately after the approvals.
the approvals themselves are a user approval waiting for "anyone to approve"...
it won't pass the join till 1 person from every approval has approved.. and when one approves for an item the others are marked as not needed.
the easy part about it is you only have to change two fields in each script to make add another one.
________________________
just in case you want it this is the code for the approvals..
answer = [];
appr();
function appr(){
var app = new GlideRecord('u_server_to_service');
app.addQuery('svc_name',workflow.scratchpad.apprvr_ary[2]);
app.query();
while(app.next()){
var people = new Array();
var list = app.svc_u_service_owner.toString();
people = list.split(',');
for (i = 0; i < people.length; i++)
{
answer.push(people[i]);
}
}
}