The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how can i find users group

Ugur GUNGOR
August 11, 2014

hello i am new on jira. i am writing a validation. i wrote this

from com.atlassian.jira.issue import Issue
user=issue.getReporterId()

user returns string username. i have to find user's group. how can i do that. it must be return string value.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Philipp Sendek _catworkx_
Community Champion
August 11, 2014

Hey Richie,
I was just browsing through the libs and you might be able to solve this using:

abstract SortedSet<String>     getGroupNamesForUser(String userName)
Returns a collection of the names of the groups that the user belongs to.

OR

abstract SortedSet<Group>     getGroupsForUser(String userName)
Returns a collection of Group objects that the user belongs to.

From: https://developer.atlassian.com/static/javadoc/jira/4.4.1/reference/com/atlassian/jira/user/util/UserUtil.html

That is, if you are willing to pull the username from the reporter instead of its ID.

I hope that helps. Didn't really work with the API beyond the REST interface myself yet.

Regards,
Philipp

TAGS
AUG Leaders

Atlassian Community Events