Trying to get a group of watchers auto added when certain issue types are created. So JIRA can send out notifications to relevant parties.
Are there simple conditions or post functions that can accomplish this?
TIA.
This can be achieved by adding custom script postfunction on "Create Issue" workflow transition.
Follow below steps:
1. Add a Post function
2. Select "Script Post-Function [ScriptRunner]"
3. Select "Custom script post-function"
4. Add below code
========================================
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.MutableIssue
def userName = "username" // name of the user
def userManager = ComponentAccessor.getUserManager()
MutableIssue issue = issue as MutableIssue
def user = userManager.getUserByName(userName)
def watcherManager = ComponentAccessor.getWatcherManager()
watcherManager.startWatching(user, issue)
=========================================
5. Don't forget to move this postfunction below "Creates the issue originally"
Prerequisites: ScriptRunner app from Atlassian MarketPlace
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update issues post function from Update on Transition for JIRA can be used. You can condition (using simple regex pattern matching) the update based on the issue types you want to have this happen for. Then you provide the watcher list in the Watchers field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't see how post function can be used for this purpose - there are only 2 choises: Update Issue Status and Update Issue Field, and non of them can be used to add watchers to an issue.
Watchers - is not a field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Marty,
You might try creating a filter, share it, and then those interested people can subscribe to it. Here's one I create to get a notification each morning with a list of issues added in the past day. You could modify it to look for the issue types you want and it might work for you:
project = "Your Project" AND issuetype in (Defect, Epic, Story) AND created > -1d
HTH,
Jim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.