Approval state is changing to cancelled automatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2019 02:00 PM
The group approval in my workflow shows cancelled when the approval is completed. I wrote a script where 2 approvals are needed from a group for the approved state.
Below is the script -
var id;
var approvecount = 0;
var rejectcount = 0;
for (id in groups) {
approvecount = groups[id].approved;
rejectcount = groups[id].rejected;
}
if (approvecount == 2) {
answer = 'approved';
}
if (rejectcount == 1) {
answer = 'rejected';
}
The script does work and the "CAB approval notification" does go out and the Approval state does changes to Approved. However, the workflow for Approval-Group shows cancelled and "Approvers" state in Change Request shows "Cancelled" for the remaining Approvers instead of showing "No longer Required"
Can you explain if there is anything missing or incorrect?
Thank you,
Akshya
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2019 03:00 PM
Workflow activities get cancelled if there are errors or if the workflow ends via a different path. This usually happens when you have parallel activities defined without using branch-join activities. I see you branch out to 2 activities after CAB approval. Suggest you to add branch before them and join before the end. That way you can ensure that workflow ends after all activities have completed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 10:36 AM
Thanks for the feedback. I did add the Branch and and Join to the WF as per your suggestion but it did not work. The Approval Group still shows cancelled. I'm thinking if I need to set the Approval State to "No longer required" for rest of the approvers once the CR has been approved via my script
var id;
var approvecount = 0;
var rejectcount = 0;
for (id in groups) {
approvecount = groups[id].approved;
rejectcount = groups[id].rejected;
}
if (approvecount == 2) {
answer = 'approved';
}
if (rejectcount == 1) {
answer = 'rejected';
}
Do you have any suggestion/feedback?
Thanks,
Akshya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 10:42 AM