Hello all. I am trying to automate dynamically adding approvers to a task but the order of operations within the branching logic is preventing it from working consistently. Due to other factors within our environment, I am pulling user information out of Assets when adding approvers. I pull these users into an object in the For AQL statement, then use an Edit Work Item step to update the Approvers field, which is a multi-user select field. It seems that this branch is not working sequentially, as it seems random who the approvers end up being.
I added the "Re-fetch work item" step in an attempt to work around this and hopefully force it to wait for the edit step to finish. You can see in the Activity that the updates happen "out of sync".
I know that you can use an Approval Group, but that will not work for us due to various circumstances.
Anyone have any ideas of what I can do differently to get this field set properly? Thank you!
Hi @Malcolm Rogers -- Welcome to the Atlassian Community!
Without seeing your entire rule and audit log for context...
Using a branch to iteratively add the approvers (or any work item change) can cause update collisions, errors, etc.
For a scenario like this, I recommend instead:
Please let me know if you need more details on this approach.
Kind regards,
Bill
Thanks, Bill! This got me moving in the right direction towards a solution. I didn't need to use the split() function, I was able to condense it down a bit. My assets lookup is pulling back objects with a User-type field. I then used the Create Variable step to put that into JSON to get the proper key/value pairs:
{{lookupObjects.User.asJsonObjectArray("accountId")}}
Then I can use the Edit Work Item action to set the field:
{
"fields": {
"customfield_10003": {{ApproversJson}}
}
}
Thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.