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

Check if organization exists through servicedesk API

Rob Dubbeldam - Team Rockstars January 5, 2021

Using the Jira servicedesk API I can retrieve all the organizations (paged). 

.../rest/servicedeskapi/organization

We have 100's of organizations, I would like to verify if an organization exists and if not, add it. How can I filter/search/query on the name of an organization?

1 answer

1 accepted

0 votes
Answer accepted
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 5, 2021

@Rob Dubbeldam - Team Rockstars, there isn't a way within the endpoint itself to filter for an organization by name. 

The only way to do this is to consume the response and preogramatically iterate over each organization and check to see if it matches the organization you are looking for.

 

Thanks,

 

Kian

Rob Dubbeldam - Team Rockstars January 5, 2021

Hi @Kian Stack Mumo Systems,

Thank you for your reply, that is what I'm doing now. Do you know if there is a way to increase the limit of 50 results? Increasing the limit or maxResults doesn't have any effect. Or is there another endpoint available to get the organizations? 

 

Edit 10mins later]

Found another endpoint. Unfortunately the same results, limit also capped at 50.

...rest/servicedeskapi/servicedesk/1/organization

 

Rob Dubbeldam - Team Rockstars January 6, 2021

@Kian Stack Mumo Systems 

Found a workaround, if you post/create an organization with a name that already exists it will return the existing id. So instead of verifying if an organization exists before creating it, I will always create it. 

Like Anton likes this
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2021

@Rob Dubbeldam - Team Rockstars,  good to hear! Thanks for letting me know about that!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events