Finding reporter's organization(s)

Julie Beltz July 23, 2024

In our project, the Reporter creates a ticket via email.  We have requirement to see what Organizations they are a member of and populate the Organization field automatically. If multiple, we could not update Organization field.

In the API it looks like you can't retrieve Organizations by user's email.  Seems like we would have to step through every organization and search the member list, which could have significant runtime with growing number of organizations.

Is there another way to achieve this?

1 answer

1 vote
Dan Breyen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 23, 2024

@Julie Beltz we use Automation and API calls to get this information. You are correct, if they have more than one, you probably don't want to do it.

You can get the Reporter's Organization based on their Account ID with an API call.  

https://(INSTANCE)l.atlassian.net/rest/servicedeskapi/servicedesk/{{issue.Request Type.requestType.serviceDeskId}}/organization?accountId={{issue.reporter.accountId}}

Then with that organization, you can edit the issue and update the Organization field with the results of your API call with this:

{
"update": {
"Organizations":
[
{{#webResponse.body.values}}
{"add": {{id}} }
{{^last}},{{/}}{{/}}
]
}

The full text is too messy to add here.  Atlassian Support helped me out with it when we originally put it together.

Also, please vote for and watch this ticket.  This should be standard functionality (or at least an option) when the ticket gets created.  

Julie Beltz July 23, 2024

Thanks Dan!   Have everything working but how to know if there are multiple Orgs to skip.

Diet Bos February 13, 2025

@Dan Breyen : Does this also work if the account is a JSM account only? Or should the customer have a Atlassian account? 

 

 

Dan Breyen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2025

As long as the customer is attached to 1 and only 1 organization, it has been working for us if the customer either has a Portal Only or Atlassian account.

Like Diet Bos likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events