Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Script to list Customers in a project

Derek Fields Community Leader Dec 28, 2021

 Can you point me to an API or approach that will return a list of customers in a specific service desk? I can get the customers associated with the organizations. I don't see any API that will return the customers who are not associated with an organization.

1 answer

1 accepted

4 votes
Answer accepted
Ivan Lima Community Leader Dec 29, 2021

Hey @Derek Fields, have you tried the Get customers API. It's marked as experimental, but it should do what you're looking for.

Ivan Lima Community Leader Dec 29, 2021

I just realized you tagged the question as Server. I'll dig around to see if I can get some insight into that.

Derek Fields Community Leader Dec 29, 2021

I appreciate the help. I have looked through the entire JSM Java API and can't find anything that appears to return customers who are not associated with an organization.

I even looked through the database and can't figure out how they are associating customers with a project. It has to be in the database somewhere but I haven't found it.

Ivan Lima Community Leader Dec 29, 2021

Yeah, there is no API. A feature request, JSDSERVER-6791, was raised through this community post, SERVER REST API - How to get users without organization, which is related to what we're discussing here. As suggested in the post, I have tested the Server REST API just in case, and it doesn't work.

For the database, you can find the users, organizations and their relations in the tables: 

  • AO_54307E_ORGANIZATION_MEMBER
  • AO_54307E_ORGANIZATION

You can find all JSM tables, starting with "AO_54307E" at List of Jira Server AO table names and vendors. More details at How to Identify Active Objects AO Tables in Jira Application Database.You can also find them on your installation by navigating to JIRA_URL/plugins/servlet/active-objects/tables/list.

I noticed that if you have customers without organizations, they won't show up on the AO_54307E tables, but you can get the list of customers through the Service Desk Customers roles using the Get project roles API.

I hope that makes sense.

Derek Fields Community Leader Dec 30, 2021

@Ivan Lima That is awesome. Thanks for the direction towards the Role API. I wish I could find a matching Java API since I am writing my script in Groovy, but so be it. This will work for me. Thanks so much!

Like Ivan Lima likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Next level incident management in Jira Service Management

Hello Atlassian Community! We’re thrilled to announce some exciting changes to incident management in Jira Service Management Cloud, in order to give your teams extra muscle during incidents, and ...

1,735 views 21 12
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you