- Get started
- About
- Conditions and validators comparison
- Migration to Cloud
- Connect to Assets API
- Use cases
- Status page
- Dynamic Forms
- Dynamic Forms Overview
- Add Dynamic Fields
- Add Translations
- Configure Conditions
- Configure Validators
- Copy Dynamic Fields
- Display Dynamic Fields
- Dynamic Fields in Team-managed projects
- REST API
- Use Case
- Supported fields
- Bundled Fields
- Bundled Fields Overview
- Global Configuration
- Project Configuration
- Display Bundled Fields
- Search with Bundled Fields
- Automation
- Request details view
- Customization Overview
- Display Additional Details
- Display Attachments
- Display Related Issues
- Display SLAs
- Use Case
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:
Bundled Field visible in the 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
- 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.
- 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}"}}
- Save and publish the rule.
- 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.
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:
Subfield’s value in the 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.
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"
]
}
}
]
}
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.
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
Issue with a comment
Edited subfield
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.