Impacted Services and Change Approvals

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2010 01:14 PM
Once the Impacted Services is refreshed, which we are going to have do when the Change moves out of the planning stage, I need to send an approval to all of the Approval groups for all of the Impacted Services on the list. Has anyone done this before and whats the easiest way to get this done? Its looking like to me I am going to have to add a bunch of manual group approvals. I am hoping there is an easier way to do this.
Any suggestions would be appreciated.
Drew

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2010 01:45 PM
I would use graphical workflow to generate and manage the approvals. There are some sample scripts here that should be pretty close to what you are looking for.
http://www.servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2010 05:21 AM
Thanks for the reply it was very helpful I just have one issue, for some reason it will not run the script to get the groups.
I do not even see the first log entry of "Change Approval In Script". I copied the script and ran it under "Scripts - Background" and it ran fine and returned results, but when it is in the work flow it is not running and I'm not sure why.
Here is the script
gs.log("Change Approval In Script");
//Initialize an answer array to be returned
var answer = [];
//Add the Change's Affected Item.
answer.push(current.cmdb_ci.change_control);
//Get all of the Business Services affected.
var m2m = new GlideRecord('task_cmdb_ci_service');
m2m.addQuery("task", current.sys_id);
m2m.query();
while(m2m.next()){
var cis = m2m.cmdb_ci_service.getRefRecord();
answer.push(cis.change_control);
gs.log("Change Approval Group: " + cis.change_control);
}
Any assistance would be appreciated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2010 06:27 AM
Hard to say, but here are a couple of things you could check...
-Make sure you are using a Group Approval activity
-Make sure that the 'Advanced' checkbox is checked
-Try removing the entire script and simply logging a single line. If that still doesn't work then I'm not sure what might be going on. If it does work, then add the script back piece by piece until it breaks to find the line causing the issue.
The only thing I see that looks a little bit different with your script is the 'getRefRecord' line. I don't think it's necessary. You should be able to remove that line and just push 'm2m.cmdb_ci_service.change_control' into your array. You should be able to remove any reference to the 'cis' variable in your script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2010 07:27 AM
Ok, should have thought of your last suggestion, it looks like there is something wrong with the rest of the script because it does run when there is just a single logging line.
I agree on the getRefRecord, I did it just to make sure I was not doing something wrong.
Thanks for the assistance.