JIRA REST API: How to search groups by case insensitive value

N July 10, 2017

Hello, everyone

How can I ignore case sensitiveness of query parameter during getting groups with the help /rest/api/2/groups/picker?

Right now:
/rest/api/2/groups/picker?query=aaa returns group Test aaa.
/rest/api/2/groups/picker?query=aAa returns group Test aAa.

What I need is - get both groups (Test aaa and Test aAa ) using rest/api/2/groups/picker?query=aaa or rest/api/2/groups/picker?query=AAA

Thanks.

2 answers

0 votes
Jānis Liepa April 24, 2020

I created a similar ticket and the response is:

Not possible, unfortunately. But there's a feature request to bring this to Cloud:

JRACLOUD-71706: Make group picker case insensitive for /rest/api/3/groups/picker 

Watch the ticket to be kept updated on the progress of the feature.

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 18, 2017

Hi Natalia,

One thing you can do is change the = to a ~ which performs a fuzzy search.  If I search with the = sign I get one result:

{"header":"Showing 1 of 1 matching groups","total":1,"groups":[{"name":"aaa","html":"<b>aaa</b>","labels":[]}]}

When I use the tilde I get multiple results:

{"header":"Showing 3 of 3 matching groups","total":3,
"groups":[{"name":"aaa","html":"aaa","labels":[]},
{"name":"jira-administrators","html":
"jira-administrators","labels":
[{"text":"Admin","title":"Users added to this group will be given administrative access","type":"ADMIN"},
{"text":"JIRA Software","title":"Users added to this group will be given access to <strong>JIRA Software</strong>","type":"SINGLE"}]},
{"name":"jira-software-users","html":"jira-software-users","labels":
[{"text":"JIRA Software","title":"Users added to this group will be given access to <strong>JIRA Software</strong>","type":"SINGLE"}]}]}

For more information about searching in JIRA see the Search syntax for text fields knowledge base article.

Cheers,

Branden

Jānis Liepa April 22, 2020

When changing ?query= to a ?query~ in REST API URL it does not performs a fuzzy search, but instead returns all values.

You can try that by adding completely different query.

Suggest an answer

Log in or Sign up to answer