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).
Hi @Alistair Adams and happy Monday.
Not totally sure if this helps but have you tried to re-fetch data in your Automation rule to make sure the newest data is available to the rule?
HTH,
KGM
Hi @Kristján Geir Mathiesen happy Monday to you!
Well, I hadn't looked at the Re-Fetch action so thank you for pointing me to that!
It did the job though does slow things down but can live with that. I'm now scratching my head trying workout how Jira has implemented this because that wouldn't have been the obvious solution to me :). It seems more analogous to a sync on Unix/Linux and if they'd used that name I might have found it myself.
So, for posterity, here's how I solved it. I first cleared the Stakeholders. Then I have several of these If:matches that all follow the pattern below.
In the Edit issue I used the "Copy from issue" (I removed the names that would be added after that for privacy). Without the Re-fetch action it would just use whatever names were in the issue when the automation was triggered.
I'm always open to see if people have better ways of doing this.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.