I am trying to get the UserManager in Jira 5.1 in a groovy script, which I'm porting to new Jira, but obviously I'm doing something wrong, this being the first time when I write groovy code.
https://gist.github.com/3170993
import com.atlassian.jira.user.util.UserManager import com.atlassian.jira.user.util.DefaultUserManager userManager = (UserManager) DefaultUserManager() // also tried .get() or .getInstance() but it doesn't seem to work.
Community moderators have prevented the ability to post new answers.
Use ComponentAccessor or inject it in the constructor.
For grrovy, using ComponentAccessor may be the way to go!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
// thanks, add this to your answer ;)
import com.atlassian.jira.component.ComponentAccessor userManager = (UserManager) ComponentAccessor.getUserManager()
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.