Approvals are not set to "No longer required"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I have a requirement that when group approval is triggered for a request, and if any new members added to that group, then that users should also see the approval record.
I have created a after BR on sys_user_grmember table, currently when request is created and group approval triggered and afterwards when i add new users to that group, the users could see the approval record. the issue is when the request is approved by anyone of the group member, other approval records are moved to "no longer required", but newly inserted approvals on sysapproval_approver are not moved to "no longer required", still is in "requested" state.
Any help would be appreciated. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
If you have a (legacy) workflow with an Approval - Group activity, you'll need to put that within an Approval Coordinator activity to also handle the manual approvals that you are creating with the BR. I'm not sure if there's an equivalent action necessary for Flow Designer/Workflow Studio. Also take a look at the createUserApprovals function in the WorkflowApprovalUtils Script Include that the out of box Business Rule calls when a group approval is created to create the user approvals. Maybe one of these other fields on the approval record that's created is needed by the BR that is updating the State of the others.
var ids = this.getMembersOfGroup(groupApproval.assignment_group);
var state = groupApproval.approval + '';
var taskId = groupApproval.parent + '';
var approvalId = groupApproval.sys_id + '';
for (var i = 0; i < ids.length; i++) {
var approval = new GlideRecord('sysapproval_approver');
approval.initialize();
approval.sysapproval = taskId;
// fill out reference to task with the in-memory GlideRecord.
// When "Approval Events (Task)" runs it will be able to obtain the task type even though it doesn't yet exist in DB
var target = groupApproval.parent.getRefRecord();
approval.sysapproval.setRefRecord(target);
approval.source_table = target.getRecordClassName();
approval.document_id = target.sys_id +'';
approval.group = approvalId;
approval.approver = ids[i];
approval.wf_activity = groupApproval.wf_activity;
approval.state = state;
if (state == 'approved')
approval.setValue('comments', gs.getMessage('Automatic approval'));
approval.expected_start = groupApproval.expected_start;
approval.due_date = groupApproval.due_date;
approval.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Brad Bowman ,
Thanks for the reply,
I have checked the OOTB BR which you have mentioned and this BR is for creating group approval from workflow, we are triggering group approval from flow designer. Not sure how the user approval created if it is triggered from flow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Since you are using Flow Designer to ask for the approval from the group, you just need to add an OR Anyone approves Manual User(s) so that it looks similar to this
When adding this condition, the Manual User(s) criteria is added using the third icon - the rubber stamp, or whatever that's supposed to be with the plus sign
In this way, if user approvals are added in addition to the ones that Flow Designer adds from the group, any approval will cause all of the others to be 'No Longer Required'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago