We are using Groovy script as a post function during the create transition and it errors as below
package com.onresolve.jira.groovy.canned.workflow.postfunctions
import com.atlassian.jira.ComponentManager
def componentManager = ComponentManager.getInstance()
def watcherManager = componentManager.getWatcherManager()
def userManager = componentManager.getUserUtil()
def watchUsers = {usernames ->
usernames.each {
def user = userManager.getUser(it)
watcherManager.startWatching(user, issue.getGenericValue())
}
}
//Users can be added and removed from this list below. Make sure the names are in quotes and are comma separated.
// def users =
Error as below
- Script68.groovy:6 [Static type checking] - Cannot find matching method com.atlassian.jira.ComponentManager#getWatcherManager(). Please check if the declared type is right and if the method exists. @ line 6, column 22.
- Script68.groovy:7 [Static type checking] - Cannot find matching method com.atlassian.jira.ComponentManager#getUserUtil(). Please check if the declared type is right and if the method exists. @ line 7, column 19.
- Script68.groovy:11 [Static type checking] - Cannot find matching method java.lang.Object#getUser(java.lang.Object). Please check if the declared type is right and if the method exists. Possible solutions: getAt(java.lang.String) @ line 11, column 21.
- Script68.groovy:12 [Static type checking] - Cannot find matching method java.lang.Object#startWatching(java.lang.Object, org.ofbiz.core.entity.GenericValue). Please check if the declared type is right and if the method exists. @ line 12, column 10.
- Script68.groovy:12 Use the Data object getters instead. Since v5.0. @ line 12, column 45.
- Script68.groovy:12 Use the Data object getters instead. Since v5.0. @ line 12, column 45.
Can anyone assist on this? We have JIRA v7.1.10.