Group approvals are all getting set to same value (Approved/Rejected) after last group approves/rejects

CJB
Tera Expert

I will preface by stating that this is apparently working as intended according to documentation, but I was hoping something could be done to keep it from happening. As noted in the documentation, this only happens when the "Condition based on script" option is used in the approval workflow activity. The other group approval options (An approval from each group, An approval from any group, etc) do not change the group approval values.

Let's say there's 3 groups:

  • The user from the first group approves. The approval group switches from requested to approved.
  • The user from the second group rejects. The approval group switches from requested to rejected.
  • The user from the third group approves. The approval group switches from requested to approved.

After the final group has approved, the overall status is rejected, which I want so it goes down the correct route; however, the two groups that showed approved now change to rejected. This only occurs when using "Condition based on script." Other group approval types keep their approval status. Is there a way to keep the groups statuses from changing?

2 REPLIES 2

Allen Andreas
Administrator
Administrator

Hi,

The workaround mentioned in that support article, does that not work for you?

Please mark reply as Helpful/Correct, fi applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi @Allen Andreas. I tried to use "setWorkflow(false)" as stated in the support article. On the group approval table, I wrote a business rule that included setWorkflow(false), but it just stop any additional user approvals from switching to No Longer Required; they just continue to state Requested. It doesn't seem to have any effect on the group approval values though. All group approvals still switch at the end (after all group approvals have been recorded).

(function() {
    var matchingId = current.parent;
    grCI = new GlideRecord('sysapproval_group');
    grCI.addQuery('parent', matchingId);
    grCI.query();
    if (grCI.next()) {
        var parent = grCI.parent;
        gs.info('testing:' + parent);
        current.setWorkflow(false); //Do not run business rules
        current.update;
    }
})();