Hi there,
I have a Create Sub-tasks post-function that's creating 10 different sub-tasks (part of an onboarding proecess) in a Task workflow (using Bob Swift CoT). The problem is, the executor of that transition does not want to be set as a Watcher on each subsequently created Sub-Task, only the main Task.
In the Create transition of the Sub-Task workflow I have this Scriptrunner custom script post-function:
import com.atlassian.jira.component.ComponentAccessor
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def locale = ComponentAccessor.getLocaleManager().getLocaleFor(user)
def watcherManager = ComponentAccessor.getWatcherManager()
def watchers = watcherManager.getWatchers(issue, locale)
watchers.each { watcher ->
watcherManager.stopWatching(watcher, issue)
}
However, the executing user of the transition on the Task is still being set as a watcher for each produced Sub-Task. Any ideas on how to get around this? Thank you so much!
-Andrew