Apps documentation
Extension for Jira Service Management
Cloud Server/Data Center
Extension for Jira Service Management

Cloud

Server/Data Center

Documentation
FAQ
Release notes
Articles & Videos
Last updated May 15, 2022

Automation

Learn how to use Bundled Fields in automation rules

When creating automation rules in Jira, you can access your Bundled Fields properties and subfields to make them visible and usable in various automation rules.

Accessing Bundled Fields in automation

When using automation, you can display the values from Bundled Fields and use them while creating conditions. In order to do so, insert a smart value to your rule including the ID that refers to your Bundled Field, for example:

{{issue.customfield_10066}}

Smart value in automation configuration:

Extension for Jira Service Management - Smart value in Jira automation
Extension for Jira Service Management - Smart value in Jira automation

Bundled Field visible in the email:

Extension for Jira Service Management - Bundled Field in email
Extension for Jira Service Management - Bundled Field in email

Accessing subfields in automation

If you want to create a condition in automation that relies on the properties of individual subfields, you can access them using the following command:

{{issue.properties."com.deviniti.extension.bundledfield_{CUSTOMFIELD_ID}"."{SUBFIELD_ID}"}}

While the CUSTOMFIELD_ID of the Bundled Field is visible on the Manage apps screen, the SUBFIELD_ID can be obtained only by executing certain commands in the rules.

Obtaining subfield ID

Steps

  1. In order to get a subfield ID, create a test automation rule that sends an email whenever an issue is commented. This way you’ll see the output from the commands.
    Note

    Before creating the rule, make sure your issue contains a Bundled Field.

  2. In the content of the mail, insert the command below to display all the Bundled Field subfields along with their IDs.
{{issue.properties."com.deviniti.extension.bundledfield_{CUSTOMFIELD_ID}"}}
  1. Save and publish the rule.
    Extension for Jira Service Management - Access Bundled Field properties
    Extension for Jira Service Management - Access Bundled Field properties
  2. Execute the rule.
    Info

    For more information about creating rules with automation, see Atlassian documentation.

Result

The command displays the IDs and their corresponding subfields. For example, the Backend Developer subfield has an ID 10004.

Extension for Jira Service Management - Subfield ID in Jira automation
Extension for Jira Service Management - Subfield ID in Jira automation

Displaying subfield’s value

Now that you have your subfield’s ID, you can access its exact value using the full command from the beginning of this section.

Command in the automation rule:

Extension for Jira Service Management - Access subfield
Extension for Jira Service Management - Access subfield

Subfield’s value in the email:

Extension for Jira Service Management - Subfield in email
Extension for Jira Service Management - Subfield in email

Other commands

Below you can see some commands that refer to Bundled Fields and their individual subfields.

Getting the quantity of Bundled Fields in an issue

{{issue.properties."com.deviniti.extension.bundledfield_{CUSTOMFIELD_ID}"."{SUBFIELD_ID}".size}}

Returns the length of the list with values for a given subfield. This way you can check how many Bundled Fields there are in an issue. This command is particularly useful when using the If/Else comparison block in automation.

Getting the Nth element from Bundled Fields in an issue

{{issue.properties."com.deviniti.extension.bundledfield_{CUSTOMFIELD_ID}"."{SUBFIELD_ID}".get(n-1)}}

When there’s more than one Bundled Field in an issue, this command will return the value of a subfield basing on the provided index.

Note

Keep in mind that the indexing starts from zero. It means that in order to get the first value in a list, you need to insert 0 inside the get operator, for example get(0).

Editing subfields

You can edit the subfields when using the Edit issue automation rule. To do so, you need to insert the following JSON structure into the Edit issue field and assign values to each subfield from the Bundled Field:

{
  "properties": [
    {
      "key": "com.deviniti.extension.bundledfield_{CUSTOMFIELD_ID}",
      "value": {
        "{SUBFIELD_ID_1}": [
          "YOUR VALUE"
        ],
        "{SUBFIELD_ID_2}": [
          "YOUR VALUE"
        ]
      }
    }
  ]
}
Note

Keep in mind that you need to assign values to all the subfields in a given Bundled Field, even if you want to edit only one or some of them. Subfields without their defined values will appear empty once the rule is executed.

Example

Below you can see a rule which, once triggered, will change the subfield’s value from Tester to Senior Tester:

Automation rule triggered by a comment

Extension for Jira Service Management - Automation rule
Extension for Jira Service Management - Automation rule

Issue with a comment

Extension for Jira Service Management - Issue with a comment
Extension for Jira Service Management - Issue with a comment

Edited subfield

Extension for Jira Service Management - Edited subfields
Extension for Jira Service Management - Edited subfields
Need help?

If you can’t find the answer you need in our documentation, raise a support request.
Include as much information as possible to help our support team resolve your issue faster.