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 if the issues are removed from the field automatically.


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





Boolean condition

UI Step

Add a Condition under the action → Boolean Condition 


UI Step

Expression

Use the following Parser Expression.

Code Block
languagebash
linenumberstrue
%{trigger.issue.cfIssuePicker} != 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

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







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} = \"KPCASE\"",
                "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": "issuesallIssues",
                        "destinationIssueSelectionIssues": "issueKeysToIssueList(toString(toStringList(replaceAll(previousValue(%{issue.cf10700}),\"\\\\[|\\\\]\", \"\"),\",\") EXCEPT toStringList(%{issue.cf10700},\", \")))",
                        "destinationIssueSelectionIssueKeyParsingMode": "textAdvanced",
                        "actingUser": "field_00020"
                    },
                    "children": null,
                    "hasChildren": false
                },
                {
                    "sequence": 12,
                    "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
headingsJWT feature, Workflow function, Parser functions, Label
sortByTitle
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