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?
@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.
Thanks Dan! Have everything working but how to know if there are multiple Orgs to skip.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dan Breyen : Does this also work if the account is a JSM account only? Or should the customer have a Atlassian account?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.