Set Watcher Based on Asignee

Katherine Knochel April 22, 2016

Is it possible to automatically set a watcher based on ticket assignee?  I would like to automatically add the assignee's manager to every ticket to which they are assigned.

3 answers

0 votes
Tibor Hegyi _META-INF_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 24, 2016

To determine the manager of a user, we normally recommend the following strategy:

  • for users having a manager, story the manager's user name (or user key) as a user property in the user profile
  • if the manager infromation is available in Active Directory / LDAP, synchronize the user property from AD/LDAP so that you can manage the user-manager relation in AD/LDAP. There are add-ons offering this.
    If you do not have AD/LDAP, you can use JIRA REST API to automate setting managers in the user property. 
  • Once the manager's username is stored as a user property, you can use Script Runner to extract the property and add the user as a watcher.

Obviously a custom add-on is always a solution. This would include a manager admin UI and a post-function to add manager as watcher.

0 votes
Chris Dunne
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.
April 23, 2016

If you find out how to do this I'd be interested in knowing your solution. Particularly how do you determine the manager for the current assignee.

 

 

0 votes
GabrielleJ
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.
April 22, 2016

You will need a scripted post-function to do that. My issue here is how do you determine the assignee's manager? If that won't be a problem, try different scripted post-functions for automatically setting Watchers based on a condition. There's a lot of them in the marketplace (Try the JIRA ScriptRunner).

Suggest an answer

Log in or Sign up to answer