Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel

On this page

Table of Contents
maxLevel2
exclude(On this page|Use case).*
stylecircle
typeflat
separatorpipe



UI Text Box
sizemedium
typeinfo

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

UI Steps


UI Step

Create a new rule and name it appropriately.

UI Text Box
typetip

Providing a description will help you to identify what the rule does but this step is optional.




Field changed event


UI Step

Add a trigger → Field changed event


UI Step

Field

Select the ScriptRunner Issue Picker field


UI Step

Change to

Select Any value



Boolean condition


UI Step

Add a Condition next to the trigger → Boolean Condition 


UI Step

Expression

Use the following Parser Expression after replacing the project key with the one of the project of your choice.

Code Block
languagebash
linenumberstrue
%{trigger.issue.project.key} = "CASE"





UI Step

Next to the Boolean Condition click on Add → Action → Delete issue link

UI Steps


UI Step

Issue link type

Choose relates to (Relates)


UI Step

Issue selection

Choose All issues


UI Text Box
typewarning

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


UI Step

Add a Condition under the action → Boolean Condition 


UI Step

Expression

Use the following Parser Expression after replacing the field code %{trigger.issue.cfaaaaa} with the one for the ScriptRunner Issue Picker field.

Code Block
languagebash
linenumberstrue
%{trigger.issue.cfaaaaa} != NULL







UI Step

Next to the Boolean Condition click on Add → Action → Create issue link

UI Steps


UI Step

Issue link type

Choose relates to (Relates)


UI Step

Issue selection

Choose Issue List Expression


UI Step

Use the following Parser Expression after replacing the field code with the one for the ScriptRunner field.

Code Block
languagebash
linenumberstrue
issueKeysToIssueList(%{trigger.issue.cfaaaaa})







UI Step

Enable the rule by clicking on the Enable button → 







UI Expand
titleJSON

Import the example

Import the JSON file below to get started in no time

UI Text Box
typewarning

After importing the JSON file, make sure to check the configuration of the rule. Non-existing configuration elements (issue types, fields, values etc.) will be highlighted.


Code Block
languagejs
themeMidnight
linenumberstrue
{
    "name": "Add links to the issues in a ScriptRunner Issue Picker field",
    "description": "Add links to the issues included in a ScriptRunner Issue Picker field and delete them if the issues are removed from the field automatically.",
    "creator": "admin",
    "status": false,
    "triggerData": "",
    "triggerType": "FIELD_CHANGED_EVENT",
    "configuration": {
        "refs": [
            "issue",
            "system",
            "trigger.issue",
            "trigger.parent"
        ],
        "fieldId": "10700",
        "option": "any"
    },
    "children": [
        {
            "sequence": 0,
            "type": "BOOLEAN_CONDITION",
            "ruleEntityType": "CONDITION",
            "configuration": {
                "refs": [
                    "issue",
                    "project",
                    "system",
                    "trigger",
                    "trigger.issue",
                    "trigger.parent"
                ],
                "expression": "%{trigger.issue.project.key} = \"CASE\"",
                "expressionParsingMode": "logical",
                "actingUser": "field_00020"
            },
            "children": [
                {
                    "sequence": 0,
                    "type": "DELETE_ISSUE_LINK",
                    "ruleEntityType": "ACTION",
                    "configuration": {
                        "refs": [
                            "issue",
                            "project",
                            "system",
                            "trigger",
                            "trigger.issue",
                            "trigger.parent"
                        ],
                        "issueLinks": [
                            "inwards_10003"
                        ],
                        "destinationIssueSelection": "allIssues",
                        "destinationIssueSelectionIssueKeyParsingMode": "textAdvanced",
                        "actingUser": "field_00020"
                    },
                    "children": null,
                    "hasChildren": false
                },
                {
                    "sequence": 2,
                    "type": "BOOLEAN_CONDITION",
                    "ruleEntityType": "CONDITION",
                    "configuration": {
                        "refs": [
                            "issue",
                            "project",
                            "system",
                            "trigger",
                            "trigger.issue",
                            "trigger.parent"
                        ],
                        "expression": "%{trigger.issue.cf10700} != NULL\r\n",
                        "expressionParsingMode": "logical",
                        "actingUser": "field_00020"
                    },
                    "children": [
                        {
                            "sequence": 0,
                            "type": "LINK_ISSUE",
                            "ruleEntityType": "ACTION",
                            "configuration": {
                                "refs": [
                                    "issue",
                                    "project",
                                    "system",
                                    "trigger",
                                    "trigger.issue",
                                    "trigger.parent"
                                ],
                                "issueLinkType": "inwards_10003",
                                "destinationIssueSelection": "issues",
                                "destinationIssueSelectionIssues": "issueKeysToIssueList(%{trigger.issue.cf10700})",
                                "destinationIssueSelectionIssueKeyParsingMode": "textBasic",
                                "actingUser": "field_00020"
                            },
                            "children": null,
                            "hasChildren": false
                        }
                    ],
                    "hasChildren": true
                }
            ],
            "hasChildren": true
        }
    ],
    "hasChildren": true
}



Related use cases

Page properties report
firstcolumnUse case
headingsAutomated action, JWT feature, Workflow function, Parser functions, LabelsortByTitle
cqllabel = "use-case-auto" and label in ("create-issue-link","delete-issue-link") and space = "JWTSDC"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue





Page properties
hiddentrue



Status
Tech review

Status
titletodo

Style guide

Status
titletodo

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged