JSM Automation to assign value to Organization (shared with)

M Ryan August 25, 2022

We are trying to create automation to share a ticket with an "Organization" at the time the ticket is created (using the "Shared with" field). The "Organization" the ticket is shared with depends on the value of a custom field in the ticket (Participant).

For example if the Participant is Jerry, we want the ticket shared with Organization Jerry so that he can view the ticket from the client portal (Jerry is external).

The "Shared with" field is not available in the automation - not sure if this can be done with JSON code. 

 

Thanks!

3 answers

1 accepted

3 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.
August 25, 2022

Hi @M Ryan - You can do this with automation, but fair warning that you need to be able to identify the organization ID.  So, this is not a straightforward endeavor.  Also, note that unless you have your organization security wide open, the participant has to be in the same organization as the reporter so you may as well perform the check against the reporter.

This is how I've done it in the past:

  1. You'll need to perform a Send Web Request action and call the Jira API to find the list of organization(s) the reporter is a member of and get the organization ID.  Here's the API you'll need to hit:
    1. https://INSTANCE.atlassian.net/rest/servicedeskapi/organization?accountId={{issue.reporter}}
  2. If they are a member of multiple organizations, you'll need to perform a bit more magic here with business logic to determine which of the returned organizations you want to work with
  3. Organizations is a custom field so you'll need the ID of that custom field
  4. You'll use JSON in the edit issue action:
    1. {
      "fields": {
      "customfield_xxxxx": [{{webResponse.body.values.id}}]
      }
      }
M Ryan August 26, 2022

Thanks Mark - I will test this and see if I can get it to work. The reporter and the participant are not be in the same organization - reporters will be internal, participants  will be external (they don't log tickets for the most part, only update them). Participants are only members of one organization (employees of the org).

0 votes
Abraham - New Verve Consulting March 16, 2023

Hi @M Ryan,

To extend native Jira Organization features, you can consider using Crumbs.
You can use the newly released Crumbs API + Jira Automation together to link organizations automatically or to populate fields with organization data from Crumbs.

There is a page with screenshots about how to do this here: 

Copy customer fields to an issue

Hope this helps! If you have anymore questions or need further instructions you can submit a support request too :)

0 votes
M Ryan August 26, 2022

Thanks for your response Mark. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events