Is there a way to add a watcher to a set of issues in batch?

IDT Telecom October 31, 2011

Is there a way to add a watcher to a set of issues in batch?

i.e. Select all issues for a certain project and add a specific watcher to all of them in one shot?

Thanks!

3 answers

1 accepted

1 vote
Answer accepted
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.
October 31, 2011

JIRA Command Line Interface has an addWatchers action. That can be use with the runFromSql action to select issues and add one or more user ids as watchers.

IDT Telecom October 31, 2011

Thanks so much Bob - I'll try it out!

IDT Telecom October 31, 2011

Bob, the doc shows:

jira --action addWatchers   --issue "ZJIRACLI-2"    --userId "user, developer"  
 
Does this mean I have to issue this CLI for each issue, or can I put in a "macro" to add the watcher to multiple issues in one shot?
Something like:
jira --action addWatchers   --issue "ZJIRACLI-*"    --userId "user, developer"  
(note the splat)
 
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.
October 31, 2011

No, just one at a time. However, use runFromSql to issue the command for each issue selected by your SQL - assuming you have access to the jira database. You will need your database specific access information, but it would be something like:

jira --action runFromSql --common "--action addWatchers --userId user1,user2" --sql "select pkey as "issue" from jiraissue where pkey like 'XXX-%'" --database jira --driver postgresql --dbUser admin --dbPassword admin --host dbserver

Of course you should be careful and test this on a couple of issues first and/or use --simulate

IDT Telecom October 31, 2011

Again, thanks so much for your swift and helpful responses.

0 votes
boardtc
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.
July 25, 2012

We need this to be added to the bulk edit UI. Duplicated by https://answers.atlassian.com/questions/24497/can-add-watchers-in-bulk

0 votes
Paul Douglas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 18, 2012

Is there a way of doing this in the UI?

Suggest an answer

Log in or Sign up to answer