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,456,612
Community Members
 
Community Events
176
Community Groups

Add watcher automatically based on a custom field

I have a custom field 'Evaluators' where the user can select multiple people from the organization. Is it possible to create an automation that would pick up the evaluators from the field and add them as watchers on the issue?

8 answers

3 accepted

4 votes
Answer accepted

Hi @Ani Popova 

Yes you can! Use the following rule and replace approvers with Evaluators:

approvers.png

Keep in mind that evaluators must have permissions to view the issues.

John Funk Community Leader Sep 15, 2021

Ah! Well done, Alex!

Like # people like this

Hmmmmm, that's a very good idea actually, thanks a lot!

Like # people like this
1 vote
Answer accepted

Hi @Ani Popova 

If you are selecting those evaluators from the Jira users, and you can get the accountId from the selections, then you may add them as watchers with an automation rule.

The trick may be to split out the accountId values from the field, split it into a list, and then use advanced branching to iterate over them to add each watcher.  Another way might be to use advanced edit with JSON to add them all at once.

Kind regards,
Bill

Withdrawing my answer, based upon Darryl's comments.

I see what you mean, that's going to take a long branch rule, because probably have about 15-20 people to loop through, but it would work! 

The disadvantage would be that every time a new person gets hired, I will have to change the rule. 

Hi, Ani!  This would still be dynamic; the values from the field drive the new advanced branch mechanism which was recently added.  So the branch would just have a few components.

For now, I recommend starting with what Alex suggests based upon the field-value changed trigger.  If you run into challenges with add/remove watchers and duplicate watchers, this other technique could help.

Kind regards,
Bill

Withdrawing my answer, based upon Darryl's comments.

Whoa whoa whoa! :-}

As much as I love complex branching rules that can iterate over lists, this one can be solved much more easily, because thankfully, Atlassian/CodeBarrel implemented Watchers differently than other fields.

And you can actually add Watchers without affecting existing Watchers (which was my concern with doing any kind of fancy JSON).

Like # people like this
1 vote
Answer accepted
John Funk Community Leader Sep 15, 2021

Hi Ani,

Unfortunately, automation only has the ability to have an actual username selected to add to the watcher field not not groups or values from other fields. 

You might could do it via the API, but that is out of my expertise. 

Darryl Lee Community Leader Sep 15, 2021

Hey @John Funk sorry, but this isn't actually correct:

watchers.jpg

John Funk Community Leader Sep 15, 2021

Yep - noted above

My automation rule runs only indicate in addWatcher {{issue.fields.People.accountId}}.

Definitely {{issue.fields.People.accountId}} should be default functionality 

{{issue.fields.People.displayName}} - Error watching issues

{{issue.fields.People.Name}} No actions were performed.

Hi @Ani Popova  @Quyen Nguyen 

we actually developed a free app for the Marketplace that can accomplish what you are trying to do, except it doesn't work on the create screen of issues due to restrictions by Atlassian. 

This approach is way easier than the suggested solutions via automations, although I learned some details about automations while reading them. 

With the multi-user Select custom field type provided by Awesome Custom Fields for Jira you can easily add users as participants of a ticket and directly add them as watcher while selecting them. 
You can even notify them via mail with a custom message that they are now watchers of a specific issue. 

Feel free to try! I am looking forward to hearing from you :) 

Cheers, 
Samuel

0 votes

I was looking for the same solution and followed the suggestions found on here but couldn't make it work for me. I want to update the system Watchers field with the value added to a custom Watchers field at issue creation.

However, I use the Post Function at Create transition on the workflow and it works great :-)

Add Post Function > Choose "Copy Value From Other Field" > Add > Choose the Source Field as "custom Watchers" (or whatever the name you have for that custom field), Choose Destination Field as the system "Watchers" > Add

I've attempted to do this a ton of ways based on previous and this set of answers, but I still am not getting watchers added. It says "success" but no actions performed. HELP! :)

Automation.png

John Funk Community Leader Feb 02, 2022

Use displayName instead of Name

Forgot to specify that this is a company-managed project.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events