If multiple "Ask for approval" actions are used, the previous approval records update to state "no longer required"


Description

STEPS TO REPRODUCED:

  1. create service catalog flow with two consecutive "ask for approval" actions, different approval groups
  2. make sure the approval engines is enabled on [sc_req_item] table
  3. submit the cat item, when you approved the first approval action, and the flow gets to the second approval action, the first approval record is updated to "no longer required"


the expected behavior is that the approval record is still in "approved" state

Cause

com.glide.script.GlideRecord.updateWithoutResettingOperation(GlideRecord.java:4588)
com.glide.script.GlideRecord.update(GlideRecord.java:4516)
com.glide.script.GlideRecord.update(GlideRecord.java:4435)
com.glide.policy.ApprovalRule.updateApproversIfRequested(ApprovalRule.java:131)
com.glide.policy.ApprovalActionHandler.runEngine(ApprovalActionHandler.java:59)
com.glide.policy.AScriptEngine.process(AScriptEngine.java:34)
com.glide.script.ScriptEngines.run(ScriptEngines.java:102)
com.glide.script.GlideRecord.runScriptsAndEngines(GlideRecord.java:1335)
com.glide.script.GlideRecord.updateWithoutResettingOperation(GlideRecord.java:4588)
com.glide.script.GlideRecord.update(GlideRecord.java:4516)
com.glide.script.GlideRecord.update(GlideRecord.java:4435)
com.snc.process_flow.approvals.ApprovalHelper.mootApprovalForTask(ApprovalHelper.java:254)

Resolution

  1. go to System Properties > Approval Engines
  2. turn off the approval engine for [sc_req_item] table

alternatively, you can go to system properties and update the following property

glide.approval_engine.sc_req_item to have a value of "off"