Groups Picker API not returning any data

Hey!

We use this Jira Group Picker API to retrieve all groups in our customers’ instance.

This has been working fine for us. However, we recently came across a case where this API is returning 0 groups. We haven’t been able to reproduce the issue ourselves.

Any suggestions for what might the issue be and how we can fix it?

This is a rough snippet of what our code to fetch groups for a particular instance looks like:

    rel = "/rest/api/3/groups/picker"

    def get(self):
        params = {"query": ""}
        result = self._get(self.rel, params=params).json()

Thanks!

Problems like this, with only 1 known case, often require back-end analysis (like looking at the feature flags, database, and logs). I recommend you take this one to developer support where you can safely share the customer instance where the API returns no search results.

I think this is a bug in the API. I got this as well (albeit on Jira Datacenter) and it was because the PAT (personal access token) had expired. The API ought to return 401 if the user cannot be authenticated (though to be fair the API documentation only mentions a 200 response). This was the first api call the script was making. I will now have to implement a separate check beforehand (using /rest/auth/1/session) to check the PAT is valid before trying the groups picker api call.