Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get all Users of accountType = Customer using Jira API

Lars Morten Nygaard January 17, 2024

I've looked everywhere, but I cannot find a way to query Jira for all Service Management users (accountType = "customer"). 

If I already know the exact accountID /rest/api/3/user?accountId= will return the record of a customer user, but if I try to query for all Jira users in my system, all users of this accountType is filtered out from the resultset.

Also - the Service Management API only provide a POST endpoint for Customers - but no way to query for the list. I know I can get all users for an Organization, but that's not what I'm looking for.

Thanks for any good ideas or pointers :)

1 answer

1 accepted

0 votes
Answer accepted
Deivid Araujo January 17, 2024

Hi!

 

Doesn't this endpoint return all the accountType variants?

I have tested in my instance and it worked fine.

Lars Morten Nygaard January 18, 2024

Thanks Deivid, 

The proposed endpoint require AccountID, and only need a full unfiltered list of all external users in Service Management

LarsM

 

Deivid Araujo January 18, 2024

Well, the only way I found is using this endpoint:

 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-users-search-get

 

But you'll have to do a “manual pagination”, because the endpoint return a maximum of 50 records, but it has a parameter “startAt”.

 

I don't know if you have access to API tokens, but I've made a simple Python implementation that get, parse and then exports the API return. You can access here:

 

https://gist.github.com/dvaraujo/2a8c2d9e916e06b09b7e2d4c933ab194

 

Hope this helps

Lars Morten Nygaard January 22, 2024

Thank again,

I do have all the API tokens, and have tried your proposed endpoint before, but my issue is that it only returns the internal users (our own Jira users), and not the service management users  or Customers. They have AccountID's starting with "qm:".

I may be doing something wrong, or there is a setting somewhere limiting the result to internal users.

Does your system return users with AccountID starting with "qm:......"?

Deivid Araujo January 22, 2024

Yes, it does:

jira.png

 

How many users do you have in your instance, approximately?

Lars Morten Nygaard January 23, 2024

You are perfectly right, Customers was certainly there, but after the intial search response set size.

Thanks for you support and patience.

Like Deivid Araujo likes this
Deivid Araujo January 23, 2024

I'm glad I could help :)

 

Best regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events