Automatically share requests with reporter's organizations in JSM Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Customers in multiple organizations can't natively share new tickets with all organizations. A workaround automates adding all reporter organizations to the ticket's Organization field upon creation.
Solution
Prepare to build the automation rule
Before proceeding to the automation rule creation, you will need the following:
An Atlassian API token. Check the Manage API tokens for your Atlassian account documentation. Make sure to copy and store it somewhere.
After creating the Atlassian API token, encode your credentials with base64 (you can use online tools for this). This is required to authenticate the API request on the automation rule. The format to encode is as follows:
<EMAIL>:<API_TOKEN>, for example: atlassian@atlassian.com:123456abcdefg. The value returned when encoded is what you need to use in the automation rule.
The Organization field ID is 10002. You can confirm this on your site:
Go to Settings > Work items > Custom fields.
Find the Organizations field.
Click More options (•••) > View field information.
The respective field ID will be shown at the end of the URL. For example: https://<yoursitename>.atlassian.net/secure/admin/ConfigureCustomField!default.jspa?=XXXXXcustomFieldId=10002.
Save the field's ID as it may be necessary during the rule creation.
Create the automation rule
The following steps should guide you to create the rule. In case you're not experienced in creating automation rules, refer to our Create and edit Jira automation rules for more details.
From your project, go to Project settings > Automation.
Click Create rule.
Configure the rule as follows:
Trigger: Issue created, so it triggers whenever a new ticket is raised.
Action: Send web request. Fill it in as follows:
Web request URL:
{{baseUrl}}/rest/servicedeskapi/organization?accountId={{reporter.accountid}}First Header's name:
AcceptFirst Header's value:
application/jsonSecond Header's name:
AuthorizationSecond Header's value:
Basic <the authentication encoded in base64>HTTP method: GET
Web request body:
EmptyCheck the box for "Delay execution of subsequent rule actions until we've received a response for this web request."

Action: Edit issue:
Click More options and fill the Additional fields text box as follows:
{ "fields": { "customfield_10002": [{{webResponse.body.values.id}}] } }
Now you just need to name your automation and hit the Turn it on button, which will publish and enable the automation rule.
Was this helpful?