Comments on: Change Management Workflow Approval Scripts in ServiceNow https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 20:50:57 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Change Management https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7760 Mon, 22 Jul 2019 11:13:54 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7760 Well done. You did such an amazing job. Keep it up.

]]>
By: Jim Pisello https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7758 Fri, 14 Jul 2017 16:25:17 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7758 In reply to Tony.

Hi Tony,

There are a number of possible methods for accomplishing this, depending on your specific business needs. Examining them is probably beyond the scope of this blog. We’d recommend that you post your question on the ServiceNow Community Forum.

]]>
By: Tony https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7757 Wed, 17 May 2017 23:23:48 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7757 Similar to a key person approval script. How can achieve a key group approval script. For example, i want to say that a particular group has the final say so. Any member in that group approves or rejects will override all responses.

Thank you!

]]>
By: Wes https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7756 Mon, 05 Aug 2013 18:59:41 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7756 Do you have anything that breaks up the approval list? Ie if you have 2 groups (dev and qa) and one person from each group. you see in the approval list Dev and qa grouped separately. That way if someone that isn’t familiar with the people know the QA person signed off on it but the dev person has not, vise versa… thx

]]>
By: Rose https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7755 Fri, 24 Feb 2012 21:32:08 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7755 Awesome… Thanks so much… Works Great!!!

]]>
By: Mark Stanger https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7754 Fri, 24 Feb 2012 21:23:30 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7754 In reply to Rose.

There’s a little trick you need to use when pushing items into an array from a GlideRecord query. Add ‘toString()’ to the end of all of the items you’re pushing into the array like this…

answer.push(emeacm.user.toString());

]]>
By: Rose https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7753 Fri, 24 Feb 2012 20:40:48 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7753 I’m trying to add an advanced approval script in our Change System. The form has a checkbox for each of our 3 regions, AMER, APAC, and EMEA. A change can be submitted for 1, 2 or all 3 regions. There is a Change Manager Group that contains members from each of the regions. I only want approvals to go to users from the regions that are selected on the form. When I run the script in Scripts – Background, I get an array of all the right users. When I run the workflow, I only get the last user from each region. Any ideas?

answer = [];
var amer = current.u_amer;
var apac = current.u_apac;
var emea = current.u_emea;

if (amer == true){
var amercm = new GlideRecord(‘sys_user_grmember’);
amercm.addQuery(‘group.name’,’Change Manager’);
amercm.addQuery(‘user.u_region’,’AMER’);
amercm.query();
while(amercm.next()){
answer.push(‘amercm.user’);
}
}

if (apac == true){
var apaccm = new GlideRecord(‘sys_user_grmember’);
apaccm.addQuery(‘group.name’,’Change Manager’);
apaccm.addQuery(‘user.u_region’,’APAC’);
apaccm.query();
while(apaccm.next()){
answer.push(apaccm.user);
}
}
if (emea == true){
var emeacm = new GlideRecord(‘sys_user_grmember’);
emeacm.addQuery(‘group.name’,’Change Manager’);
emeacm.addQuery(‘user.u_region’,’EMEA’);
emeacm.query();
while(emeacm.next()){
answer.push(emeacm.user);
}
}

]]>
By: narinder https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7752 Tue, 08 Nov 2011 16:42:17 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7752 Thanks for the feedback. Got to think about plan B now

]]>
By: Mark Stanger https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7751 Tue, 08 Nov 2011 16:36:53 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7751 In reply to narinder.

That’s right. If you aren’t pulling all of the members of the group in, it should be treated as a user approval rather than a group approval. There’s no way I know of to do what you want with a group approval activity within a workflow. I suppose you could set up a business rule on the ‘sysapproval_approver’ table to abort the insertion of approval records for users who should not approve, but I’m not sure how that will scale across different workflows.

]]>
By: narinder https://servicenowguru.com/scripting/change-management-workflow-approval-scripts-servicenowcom/#comment-7750 Tue, 08 Nov 2011 16:28:32 +0000 https://servicenowguru.wpengine.com/?p=2193#comment-7750 In reply to Mark Stanger.

Ahhhh ok, soo if i do this in a user approval activity….. my script looks like this below

answer = [];
var stream_sys_id = current.u_deal_business_stream;
var list = current.u_selected_stream_approvers.toString();
var gr = new GlideRecord(‘u_deal_business_stream’);
gr.addQuery(‘sys_id’,’=’,stream_sys_id);
gr.query();
if(gr.next())
{
var group = gr.u_business_stream;
answer.push(group); < -----Group ID } var grm2 = new GlideRecord('sys_user_grmember'); grm2.addQuery('group','=', group); grm2.addQuery('user','=' '23rd2e3e23e23e23e23ee32fwewe3') grm2.query(); if(grm2.next()) { answer.push(grm2.user); <-------User ID } But thing is, it does'nt create the group approval..... just create the user approval......

]]>