Can I programatically add watchers to an issue when it is created with a particular priority?

Justin Corcoran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 14, 2012

I'd like to add watchers to an issue when it is created with a priority of "emergency" so that they will get an email notification that the issue was created, and continue to be notified when status changes.

I'm also open to the possibility of not having the watchers added until the issue changes status from "New" to "Prioritized". I don't want to have to do this manually though, rather I want the watchers added as part of the creation or status change (but again, only if the priority is "emergency").

Is this possible

2 answers

1 accepted

1 vote
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 14, 2012

You can write a workflow post function to do it. If you are good in scripting, you might as well use one of the script runner plugins to execute a simple script which does this in a workflow post function!

https://developer.atlassian.com/display/JIRADEV/Workflow+Plugin+Modules

Justin Corcoran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2012

OK, I'm not at all good at scripting. Any help anyone can provide would be very much welcome.

Justin Corcoran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2012

I'm looking for something very similar to what's offered by default using the Script Runner plugin. Basically, instead of adding the current user as a watcher, i'd like to add a group of users as watchers.

Jasen Sparacino April 22, 2015

Did anyone get this figured out or something written? I might take a shot at it and if I get something I'll post here for a proper answer to this question.

0 votes
Jeremy Jeremy March 19, 2012

Justinc:

Although not exactly what you are looking for, although way I have done something like what you are taking about is create a JQL query (http://confluence.atlassian.com/display/JIRA/Advanced+Searching) that finds the issues with the priority I am looking for. I save that filter with a name that generally makes sense.

Once I do that I create a group in JIRA with all of the users I want to get notified. I then setup a subscription on that saved filter to that group and set it up to send out every x minutes. Then, when an issue gets into the "state" which I want the team to be notified, the group gets and email.

Understand that it is not quite what you wanted, but it doesn't require any programming.

Respectfully,

-Jeremy

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events