Workflow is not working as expected


Workflow is not working as expected. The if condition in the workflow is always taking the "no" path even though the condition for the "yes" path is satisfied.

Release or Environment

Kingston Release


The issue is caused due to the business rule


The issue is caused due to a custom business rule.
In the script section there is a current.update().
So whenever there is a current.update() in a business rule, then it would cause a recursive call of the same business rule until the service now back-end engine recognizes it and prevents the further execution of the business rule.
This would cause a delay in the execution of another business rule. We set the "requested_for" value as the variable value"u_requested_for" over here.
So due to this reason,  if activity in the "workflow" would run before the execution of the first BR (one with current.update()).
Therefore, when the if activity runs, the "requested_for" would still be the user who places the request. This user has the "workflow approver" value and therefore the if activity would take the "no" path. (this is the expected behaviour of the if activity)
But the "approval activity" would fetch the approvers from the variable value "u_requested_for." (and not the Request.requested_for)
So the variable value will point to the caller (in our case the caller would have the "workflow approver" as empty). Therefore no approver records would be generated and the approval activity would be skipped.
Thus to avoid the issue, please remove the current.update in the Business rule.