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

A handy option in Jira is to use issue keys in comments to reference them whenever needed. But as the amount of comments grow, it can get hard to keep track of all mentioned issues in the comments. Therefor, the following rule checks for issue keys being added to comments and automatically links them to the current issue.





UI Steps

Issue Commented event

UI Step

Excerpt Include
DECADIS:Automation Use Case - Create Rule Step
DECADIS:Automation Use Case - Create Rule Step
nopaneltrue


UI Step

Add a trigger → Issue event → Issue Commented

UI Text Box
typeinfo

No further configuration needed. The automation rule is triggered every time an issue is being transitioned.



Boolean condition

UI Step

Add a ConditionBoolean Condition 


UI Step

Expression

Use the following Parser Expression:

Code Block
linenumberstrue
findPattern(%{trigger.issue.lastComment},"([A-Z][A-Z0-9]+)-\\d+") !~ null


UI Expand
titlemore info...


UI Text Box
iconfalse
typeinfo

Boolean expressions are logical constructions that return true or false.

The findPattern() expression parser function extracts the issue key from the last comment.



Create issue link action

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
linenumberstrue
issueKeysToIssueList(toString(findPattern(%{trigger.issue.lastComment},"([A-Z][A-Z0-9]+)-\\d+")))


UI Expand
titlemore info...


UI Text Box
iconfalse
typeinfo

The findPattern() expression parser function extracts the issue key from the last comment.







UI Step
Excerpt Include
DECADIS:Automation Use Case - Enable Rule
DECADIS:Automation Use Case - Enable Rule
nopaneltrue




Screencast

This is how the configuration above should look on your screen

Multimedia
nametrack-issues-mentioned-in-comments.mp4
width700


Import the example

Import the JSON file below to get started in no time


UI Expand
titleJSON


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": "Track issues mentioned in comments",
    "description": "",
    "creator": "admin",
    "status": false,
    "triggerData": "6",
    "triggerType": "ISSUE_EVENT",
    "configuration": {
        "refs": [
            "issue",
            "system",
            "trigger.issue",
            "trigger.parent"
        ],
        "triggerType": "6"
    },
    "children": [
        {
            "sequence": 0,
            "type": "BOOLEAN_CONDITION",
            "ruleEntityType": "CONDITION",
            "configuration": {
                "refs": [
                    "issue",
                    "project",
                    "system",
                    "trigger",
                    "trigger.issue",
                    "trigger.parent"
                ],
                "expression": "findPattern(%{trigger.issue.lastComment}, \"([A-Z][A-Z0-9]+)-\\\\d+\") !~ null",
                "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(toString(findPattern(%{trigger.issue.lastComment}, \"([A-Z][A-Z0-9]+)-\\\\d+\")))",
                        "destinationIssueSelectionIssueKeyParsingMode": "textBasic",
                        "actingUser": "field_00020"
                    },
                    "children": null,
                    "hasChildren": false
                }
            ],
            "hasChildren": true
        }
    ],
    "hasChildren": true
}




Related use cases

Page properties report
headingsAutomated action, JWT feature, Label
sortByTitle
cqllabel = "use-case-auto" and label = "create-issue-link" and space = "JWTSDC"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue


JWT feature

Automated actionCreate issue link action
Parser functions

findPattern()

issueKeysToIssueList()

toString()

Label




Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Status
titleto do
Status
colourGreen
titledone
Status
colourYellow
titleneeds review
Status
colourRed
titleflagged