how can i find users group

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

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

459 views 6 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you