JIRA - Add watchers to issue based on field value

Nathan Jamin January 26, 2014

Hi all,

I have been searching the forum for a similar problem but couldn't find anything that seemed to match what I am trying to do here. Any help appreciated... Note that I am running an evaluation licence of JIRA running on our local servers.

1 transition in my workflow is to assign a number of persons who as a team will be responsible for resolving this issue. When I say "assign" I do not mean the default Jira assign function. In my case, I have a screen with 3 different user pickers.

Current behaviour: When the 3 persons are selected and I save the modification, the change is saved properly and is visible. However right now none of the 3 users is informed about this.

Requested behaviour: Upon saving, I would like the 3 selected users to be informed about this assignment and would like them to be set as "watchers" of this issue in order for them to be notified about updates.

What are my options to achieve this?

Thanks in advance for your help!

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2014

Because you aren't using the assignee field, Jira doesn't know about these assignees.

I think your best approach might be quite simple - go to your notification scheme and for the event "update", add three lines. The option to use is the "user custom field value", and you need to select each one of the three fields separately.

This will cause emails to go out to the named users, and you should do it for all the events you want them to get notified for.

Watching is a bit different - if you want to work with watchers, you're going to need a bit of scripting or code to copy the users out of those three fields and into "watchers" (and then I'd skip the notification trick above, as they'll already be watching)

Nathan Jamin January 26, 2014

Thanks Nic, for taking the time to answer - definitely a good start.

Where is the scripting done in JIRA? From the bit of research I just did it seems a separate plugin is required.

Are there any good resources out there you could recommend?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2014

Correct - there's no scripting as such built into Jira. There are a couple of add-ons which provide scripting facilities, the oldest one being Jamie Echlin's "script runner". I've not really used the others in anger, the script-runner does everything I've needed, so I can't recommend any others over it.

Suggest an answer

Log in or Sign up to answer