- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2019 02:06 PM
Hello
I added a custom condition 'conditionally approved' on Group Approvals. It is working on User Approvals But its not moving forward to other activity in Group Approvals. I need this to work in Group approvals as I need to get an approval from each group
I did all the changes as It mentioned in this url -https://old.wiki/index.php/Custom_Transitions_for_the_Approval_-_User_Activity
Can someone please help me on this.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 07:07 AM
Scrip to make the new condition work for a Approval -Group activity:
for (var id in groups) {
var group = groups[id];
/*if(groups[id].approvalIDs['conditionally_approved'])
{
answer ='conditionally_approved';
}
else */
if(group.approved>1) {
answer ='approved';
}
else if(group.rejected>0) {
answer ='rejected';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2019 08:21 PM
Hi, Group approval is the result of an update from a related user approval record. I suspect you need to review the process ‘user approvals’ utilizes to update group approvals, and make changes\additions to allowances for your new state.
Looking quickly at sysapproval_approver, I suspect you need a new BR ‘SNC - Run parent workflows (your new approval value) with appropriate approval conditions, and you will then need to also update the script include WorkflowApprovalUtils.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 07:07 AM
Thanks for your response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2019 11:04 PM
Hi
You added the the custom condition to work on the "Approval" [sysapproval_approver] table.
This is a table, where each user (as an approver) will receive a record to use for approvals.
That's why it is working on User Approvals for you!
Group approvals are stored in a different table called "[sysapproval_group].
All user related approval records, that resides by a Group approval, will have a reference to this ONE Group approval record.
Logic in the background makes sure, to update the "Group Approval" record depending on the desired scenario, e.g.
* The Group approval is set to "Approved" if only ONE User approved, OR
* The Group Approval is set to "Approved" if ALL Users approved, etc.
Now, there is a new Status value, which the current logic does not know. And that is the reason, why the new status will not be populated upwards from the user approvals to the group approvals.
My recommendation:
Do NOT add new conditions to the Approval options (even if possible - you know, everything is possible with ServiceNow, but the question is: "Does it make sense? and is it efficient?"
I recommend to Set to "Approved", but add a NEW field to the record being approved, holding the "Conditions", for your "Conditionally approved" business case.
That way, one can add the desired cause of the "conditionally approved", and you do not need to grab into the magic OOB functions of ServiceNow. I recommend NOT to change OOB scripts (like the "WorkflowApprovalUtils", as this is BASE functionality. Take care, and leave them as is - as long as anyhow possible).
If you need to branch your workflow based on the "conditionally approved", just add an IF Workflow Activiy behind your "Approved" Exit Transition, to check for the "Conditionally" field, and move on accordingly in the path of the workflow.
Marking my answer as correct & helpful give me even more motivation to contribute. Thanks!
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 07:08 AM
Thank you!