Jira Automation and Issue Picker for Jira Cloud
- 1 Set Issue key(s) to Issue Picker
- 2 Append one selected issue to already existing selected issues
- 3 Copy Issue Picker Fields
- 4 Use current attributes of selected issue in the Issue Picker
- 5 Workaround - Link selected issues on issue creation
- 6 Add (newly created) Jira-native linked Issues to Issue Picker
- 7 Add (existing) Jira-native linked Issues to Issue Picker
The following are examples on how to interact with issue picker custom fields within Jira automation.
To Edit Issue Picker Customfields it is necessary to use the ‘Additional fields’ under ‘More options’ in the 'Edit issue' component.
The code snippets for each example should help you getting the syntax right. Please update the customfield ids according to your needs.
Set Issue key(s) to Issue Picker
In this example we want to set the 'customfield_10197' to “KAN-10”.
Alternatively you can also set multiple selected issues at once.
For Single Issue:
{
"fields": {
"customfield_10197": ["KAN-10"]
}
}
For multiple Issues at once:
{
"fields": {
"customfield_10197": ["KAN-10","KAN-11"]
}
}
Append one selected issue to already existing selected issues
In this example we want to add the issue key “Kan-100” without overwriting current selected issues in the issue picker field ‘customfield_10107’.
{
"fields": {
"customfield_10107": [{{#customfield_10107}}"{{.}}",{{/}}"KAN-100"]
}
}
Copy Issue Picker Fields
In this example we want to copy the selected issues from ‘customfield_10192’ to ‘customfield_10197'.
Use current attributes of selected issue in the Issue Picker
Recommanded only for single select Issue Picker. Otherwise we would need to differentiate the selected issues via JQL further.
In this example we want to set the issue’s assignee based on the current assignee in the selected issue of issue picker field ‘customfield_10107’.
Syntax: Lookup issues
Syntax: Edit issue fields (Assignee)
Note: Please make sure that the selected issue from issue picker are also in the scope of the automation rule.
Please check Atlassian’s documentation on ‘Lookup issues’
Workaround - Link selected issues on issue creation
Issue picker does not support linking issues from the create screen. The problem is that issue picker triggers on selection of issues, at which point the issues does not exist yet for linking.
As a workaround, you can use Jira automation to achieve issue linking of selected issues from the create screen.
In this example we want to link the created issue with the selected issues in ‘customfield_10192’ using the ‘is blocked by’ link.
Syntax: Lookup issues
Syntax: Link issue to
Notes:
Using the syntax above also supports to link multiple selected issues at once.
Please make sure that the selected issue from issue picker are also in the scope of the automation rule.
Please check Atlassian’s documentation on ‘Lookup issues’
Add (newly created) Jira-native linked Issues to Issue Picker
Issue Picker does not add newly created issue links to Issue Picker fields.
You can, however, use automation to add newly created links to Issue Picker fields:
Use When: Issue linked
to start the rule on creation of a new linked issue and use the Advanced mode of Then: Edit issue field
to add the key of the destination issue of the link to to contents of the issue picker field:
Syntax: Edit issue fields
Here the ID of the Issue Picker custom field is customfield_10197
. Replace this with the respective field ID in your Jira instance.
Add (existing) Jira-native linked Issues to Issue Picker
Issue Picker does not add issues, which are already linked natively in Jira to the Issue Picker custom fields.
You can, however, create an automation that checks for natively linked issues and add them to the issue picker custom field:
Syntax: Lookup issues
Here issues with the Issue Link Type “is blocked by
“ are added to the Issue Picker custom field.
Syntax: Edit issue fields
Here the Issue Picker Field is customfield_10075
.
Notes:
Please make sure that the issues added via the automation also confirm to the Issue Picker JQL condition. As the field is edited directly, the JQL condition cannot be enforced by Issue Picker at this time.
Please make sure that the natively linked issues are also in the scope of the automation rule.
Vary the trigger of your rule according to your needs (trigger periodically or when issue link is changed on the issue).
Please check Atlassian’s documentation on ‘Lookup issues’