Adding Watchers automatically to all new Issues

How do I enable the functionality so that three users get added in the watchers list automatically? Right now I have to do it manually in all newly created issues.
0
8 comments
Official comment

This thread aged pretty well and the API this code snippet aims at has been deprecated, so I invite you to have a look at the documentation first https://www.jetbrains.com/help/youtrack/devportal/youtrack-workflow-reference.html. You can also email us at youtrack-support@jetbrains.com should you have any further questions.

Hello Mark,
I suspect, the point of adding the users in the watchers list is that you want them to receive notifications on any issue change.
If this is the case, please consider adding a saved query like 'project: projectId'. Then share the search with the users. When done, they (or any user with admin permissions) will be able to check 'on issue created' option for this saved query in their profile.

Regards,
  Alexander
0
Hi Alexander,

No, what I think he means is similar to what I currently have to do. Because you can only make one person the Project Admin there's currently no way to have some people automatically become watchers. The purpose of this is essentially so that a group of people automatically receive notifications relating to any new issues.

The only way of doing this at the moment is manually. Maybe a workflow would solve it?

Regards,
Matt
0
That is correct. I want the ability to add 2-3 predefined watchers on all newly created issue automatically. Currently, I have to do the manually.
0
Hi colleges,

this simple workflow does the trick:
rule Add watchers to new issues 
 
when becomesReported() { 
  project.getUser("user1").watchIssue(issue); 
  project.getUser("user2").watchIssue(issue); 
  project.getUser("user3").watchIssue(issue); 
}
0
That did the trick perfectly! Thanks very much Dmitry.
0

I am new to YouTrack workflows. I see the code that Dmitry Krasilschikov wrote but I don't know exactly where to paste it. Can anyone help?

0

I've created simple workflow in editor:

1

Please sign in to leave a comment.