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

How to set automatic watchers to all isues created in the project?

sledzinski
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.
May 14, 2014

How can I set automatic watchers (one or more) to all isues created in the project? I need it for JiraConnect push notifications.

6 answers

1 accepted

6 votes
Answer accepted
sledzinski
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.
May 20, 2014

I found the solution. I edit the workflow (diagram) post function in "Create issue" and add Script Post-Function - there URL: /YOUR_URL/atlassian/jira/atlassian-jira/WEB-INF/scripts/groovy/autwatcher.groovy and there I upload file (groovy script) which contains:

import com.atlassian.jira.ComponentManager

def componentManager = ComponentManager.getInstance()
def watcherManager = componentManager.getWatcherManager()
def userManager = componentManager.getUserUtil()

def watchUsers = {usernames ->
usernames.each {
def user = userManager.getUser(it)
watcherManager.startWatching(user, issue.getGenericValue())
}
}

def users = ["USERNAME"]
watchUsers(users)

And it works :)

Prashant Karakanagoudar July 27, 2018

I get below error when i tried to add custom script Post function

2018-07-27 17:48:18,320 ERROR [workflow.ScriptWorkflowFunction]: *************************************************************************************
2018-07-27 17:48:18,331 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: null, actionId: 1, file: <inline script>
groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.ComponentManager.getWatcherManager() is applicable for argument types: () values: []
 at Script154.run(Script154.groovy:4) 
1 vote
jaya p Nallamekala August 15, 2015

can we add roles as watchers in groovy scripts when an issue is created

1 vote
sledzinski
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.
May 14, 2014

I read about JIRA Component Watcher but it is now: 503 Service Temporarily Unavailable. Is it something like that what is proper?

0 votes
K Veeresh March 2, 2023

@sledzinski

You might find this info helpful.

 

Automation: 

Step 1: Issue created

Step 2: Manage watchers(hear you can add the watchers list)

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
May 14, 2014

You could add an Update issues post function to the create issue transition workflow. The general technique is describe here: How to update issues after initial issue create . Watchers is one of the things that can be set or added to.

Dilyara Saetova January 11, 2018

I don't see how post function can be used for this purpose - there are only 2 choises: Update Issue Status and Update Issue Field, and non of them can be used to add watchers to an issue.

Could you tell me, how to do that?

Jaime Drysdale August 1, 2018

This is an excellent question Dilyara, have you figured it out?

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.
August 2, 2018

Have a look at the links Bob gave.

Dilyara Saetova August 2, 2018

I just added Component Watcher plugin https://marketplace.atlassian.com/apps/5218/component-watcher-for-jira and added components to the project 

Jaime Drysdale August 2, 2018

This plugin is useless for the intended purpose of this thread (i.e.: How to set automatic watchers to all issues created in the project?). In this plugin, you must select all components that the watch will apply to... so if a new component is created, and a Jira issue raised for this new component, the watch will not be applied to it.

If the plugin had the option 'all components' it would be a different matter.

Dilyara Saetova August 3, 2018

May be you should try to ajust notification scheme in the project?
I chose the option of notifying some users when issue is created and updated and it works perfect. 

/plugins/servlet/project-config/*your project's ID*/notifications

0 votes
Bhushan Nagaraj
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.
May 14, 2014
sledzinski
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.
May 14, 2014

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events