Automation: Get all users from the project and add as Watcher

Fremie August 8, 2022

Good Day to all,

I'm currently tasked to do an automation wherein we should "gather" all users added to a certain project (project is only accessible if you're added by an admin). If a new user was added he/she could just be added on the list.

Automation setup:

1. Rule is triggered in multiple setup: 

(set up this say so that, whenever a "new user" is added it he/she will also be "listed")
- Issue Created
- Issue Updated
- Issue Transitioned

2. JQL condition
- type = task and status != "done" or type = sub-task and status != "done"

 

3. Add "all users" as watchers

( how could I get all users on just this project?? )


Sample Scenario:
Members of the project:  Me (Admin), User A, User B

I create a new issue[Tkt-01] -  (me, User A, User B) will be listed as watcher

I added a new user to the Project ~ User C

whenever I update/transition ticket - 
List of watchers should now be ( Me, User A, User B, User C ) - since user C has been added earlier



1 answer

0 votes
Mikael Sandberg
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 8, 2022

Hi @Fremie,

Welcome to Atlassian Community!

The way I would do it is using the web request action to get the members of a project role and then add the members as watchers to the issue. Automation doesn't have access to project settings, so using the REST API is the only way to go.

Fremie August 12, 2022

Hi Mikael,

Thanks for replying. That could work. May I ask for a bit of an assistance on how could I do that? I'm looking at rest API as well but I have no idea how it works

Suggest an answer

Log in or Sign up to answer