Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

JSM Automation to assign value to Organization (shared with)

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. 



2 answers

1 accepted

3 votes
Answer accepted

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:
  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": [{{}}]

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).

Thanks for your response Mark. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

An unofficial way to monitor a JSM mail handler for errors

...eturns true if any content is returned for the s...

650 views 3 19
Read article

Atlassian Community Events