Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,476
Community Members
 
Community Events
184
Community Groups

Build list of stakeholders based on list of products

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).

 

1 answer

1 accepted

0 votes
Answer accepted
Kristján Geir Mathiesen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 03, 2023

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?

re-fetch.png

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. 

Screenshot 2023-04-03 at 10.21.35 AM.pngScreenshot 2023-04-03 at 10.22.29 AM.png

Kristján Geir Mathiesen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 03, 2023

Glad you've got it figured out, @Alistair Adams !

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events