On this page
Use case
Add links to the issues included in a ScriptRunner Issue Picker field and delete them automatically if the issues are removed from the field.
Configuration
Create a new rule and name it appropriately.
Providing a description will help you to identify what the rule does but this step is optional.
Field changed event
Add a trigger → Field changed event
Field
Select the ScriptRunner Issue Picker field
Change to
Select Any value
Boolean condition
Add a Condition next to the trigger → Boolean Condition
Expression
Use the following Parser Expression after replacing the project key with the one of the project of your choice.
%{trigger.issue.project.key} = "CASE"
Delete issue link
Next to the Boolean Condition click on Add → Action → Delete issue link
Issue link type
Choose relates to (Relates)
Issue selection
Choose All issues
Please, note that this automation will remove all of the issues linked with "relates to" issue type every time that it is executed. If there are more issues than those included in the ScriptRunner Issue Picker field, they will be lost permanently.
We recommend that a issue link type reserved only for the purpose of creating issue links for this field is used.
Boolean condition
Add a Condition under the action → Boolean Condition
Expression
Use the following Parser Expression after replacing the field code %{trigger.issue.cfaaaaa} with the one for the ScriptRunner Issue Picker field.
%{trigger.issue.cfaaaaa} != NULL
Create issue link
Next to the Boolean Condition click on Add → Action → Create issue link
Issue link type
Choose relates to (Relates)
Issue selection
Choose Issue List Expression
Use the following Parser Expression after replacing the field code with the one for the ScriptRunner field.
issueKeysToIssueList(%{trigger.issue.cfaaaaa})
Enable the rule by clicking on the Enable button →
If you still have questions, feel free to refer to our support team.