JIRA REST API: How to get all groups?

Rich Scire March 16, 2016

How can I get a list of all the groups using the JIRA REST API?

3 answers

0 votes
Merielle Impreso August 20, 2019

I think the REST API is not supporting getting all the group names. However, one workaround is to use the FIND groups GET endpoint /rest/api/2/groups/picker, and add a space as query {"query" : " "}. Below is an example of the query I made in postman.

Screen Shot 2019-08-21 at 6.59.49 AM.png

Merielle Impreso August 20, 2019

Please note this: "The number of groups returned is limited by the system property "jira.ajax.autocomplete.limit" 

Peter Heubeck February 17, 2020

That is not completely true. I think it should say "The number of groups returned is by default limited by the system property jira.ajax.autocomplete.limit unless parameter maxResults is specified"

I am not sure if there is an upper limit but it seems you could just get the default number of groups (20), look at "total" attribute returned in the json data, then call again specifying maxResult to what "total" revealed. At least this works for a couple of thousand groups.

Like Matthew Korich likes this
0 votes
GabrielleJ
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.
March 16, 2016
Rich Scire March 16, 2016

Thanks, I should have mentioned that our version 6.3.15 does not have this call available. In any case, how can you use this call to get all the groups. It seems to only match sub-strings in the group names. What can you give the query parameter that will match all group names?

GabrielleJ
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.
March 16, 2016
Rich Scire March 16, 2016

I tried getGroup but the groupname parameter is required and doesn't accept a regex.

Suggest an answer

Log in or Sign up to answer