I want to build a list of stakeholders based on a list of products.
Everytime the product list changes I run an automation rule. In that rule the first thing I do is clear the list of stakeholders (its a custom multi-select userid field).
If I terminate the script immediately after this I know it works as the Stakeholders field in the issue is cleared.
BUT, if immediately after clearing the stakeholders I print it the list of stakeholders it hasn't changed. I'm using this string in the Audit Log message:
Stakeholders {{issue.fields.Stakeholders.accountId.asJsonObject("id")}}It's almost as if Jira automation has a local copy of Stakeholders and the issue doesn't get updated till the script has completed. Can someone verify if this is the actual behavior? I haven't been able to find anything in the documentation to support this theory.
My idea was to do a series of "if product contains xyz" etc. then build up the list by adding the users to the stakeholder list depending on which product items have been set (there can be more than one stakeholder per product).