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

Is it possible to search for organizations using organization name?

Tom Daudelin March 29, 2022

Hello everyone,

Objective: When client submits a jira ticket, I would like to extract their organization ID from the organization name field in the jira ticket through an automation rule.

I have been following https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-get this tutorial and was able to extract a collection of ALL organizations (and their associated ID's), however there does not appear to be a way to actually query based on the organization name.

Does anyone know of any way I could extract the organization ID based on the organization name in an automation rule?

Thank you very much

3 answers

1 accepted

2 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 29, 2022

Hi @Tom Daudelin - It is possible to capture the Organization ID and Name with a smart value.  Organization is simply another custom field so you need the ID and then this is how you would capture the name and ID respectively:

{{issue.customfield_xxxxx.first.name}}
{{issue.customfield_xxxxx.id}}
Tom Daudelin March 29, 2022

Hello Mark, but this solution would require either the client to know their internal Jira ID or it would require us on our end to know their IDs.
This is not optimal for us.
For one: This leaves us open to human error in a context of highly sensitive data (i.e should we accidentally input the wrong ID, we could be exposing data to the wrong organization).
For two, we do not know the organization's IDs to begin with. Furthermore, we cannot locally store any of these Organization:ID key value pairs given that at any point an organization we work with can change their name. And when managing an evironment with hundreds of organizations, that is a recepie for disaster.
Finally, it would be best to leverage what is already being stored by jira through : 'https://your-domain.atlassian.net/rest/servicedeskapi/organization' rather than copy it as a static table on our end.

We would like to pull the ID at runtime or find a way to store the ID's locally in a way that is scallable and dynamic.

Thank you!

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 29, 2022

I think it would help to take a step back and better understand what exactly you're trying to accomplish.  I interpreted that you wanted to establish automation rules but were unable to capture the Org ID.  Based upon that premise, the organization is captured as the customer generates a request and that value is stored on the organization field with the issue.  So, if you're trying to get the organization ID from a specific issue for the purposes of automation, you can get it as I shared in my last post.

If this is not the intent, please share a bit more about the process you're trying to automate (how you want it triggered, desired action(s) to occur, conditions, etc.).  

Tom Daudelin March 29, 2022

Ahhhhh, I understand now!
Thank you so much for the help.
In automation, {{organizations.id}} returns the organizations id as desired.
Thank you so much for the help!!

Like Mark Segall likes this
0 votes
Sankalp Chugh April 13, 2023

If you are using jira automation to find the `organization id` by `organization name` you can use the REST api for creating the organization. It also gives the organization id if the name already exists (and does not create a duplicate organization).

 

https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-post

0 votes
Warrick Hughes June 20, 2022

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events