Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get the UserManager in Jira 5?

Sorin Sbarnea (Citrix)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2012

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.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2012
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2012

For grrovy, using ComponentAccessor may be the way to go!

Sorin Sbarnea (Citrix)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2012
// thanks, add this to your answer ;)
import com.atlassian.jira.component.ComponentAccessor
userManager = (UserManager)  ComponentAccessor.getUserManager()
TAGS
AUG Leaders

Atlassian Community Events