Hi,
I have 3 components in my project :
Components1 the component lead is User1, Components2 the component lead is User2 and Components3 the component lead is User3
I want to put in my JIRA with a script
If in my ticket I choose components1 and components2 User1 and User2 are watchers of the ticket and if I put components2 and components3 User2 and User3 are watchers of the ticket.
I know I need to made a script Listeners and I have tried some scripts and things but, they didn't work,
Anyone know how to do that ?
Thank you
Hi
Try something like this:
1. you listener event is "issue updated"
2. when event fires, check issue's components.
I think you can get them using Issue interface and getComponents() method https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/Issue.html
3. get affected users.
You will need ProjectComponent interface and getComponentLead() method
https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/bc/project/component/ProjectComponent.html
4. Then set/remove these users as issue's watchers (depends on your components) using methods from WatcherManager interface https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/watchers/WatcherManager.html
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.