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

Avoid the manual work by closing the parent after checking if all sub-tasks are done, let automation do it for you!




UI Steps

Image ModifiedIssue transitioned 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 transitioned event

Image ModifiedJQL condition

UI Step

Add the following expression:

Code Block
languagebash
linenumberstrue
issuetype in subtaskIssueTypes()


Image Modified

Issue selector

Boolean condition

UI Step

Next to

the

the JQL condition click

on Add → Issue selector

on Add → Boolean condition

UI Steps


UI Step

Choose Parent issue as the target issue.

Image RemovedBoolean condition

Add the following expression:

Code Block
linenumberstrue
%{trigger.issue.status} = "Done" and count(siblingSubtasks()) = count(filterByStatus(siblingSubtasks(), "Done"))


UI Text Box
typeinfo

This way the rule execution will only continue, if the current issue was transitioned to Done and if all other sub-tasks under the current parent issue are also in status Done.




Image AddedIssue selector

UI Step

Next to the Issue selector Boolean condition click on Add → Condition → Boolean conditionIssue selector

UI Steps


%{trigger.issue.status} = "Done"

Choose Parent issue as the target issue.

UI Step

Add the following expression:

Code Block
languagebash
linenumberstrue



Image ModifiedTransition issue

UI Step

Finally, next to the Boolean condition Issue selector click on Add → Action → Transition issue

UI Steps


UI Step

Set the mode to Transition to status and choose the status Done.




UI Step

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




Screencast

No screencast available at the moment.


Import the example

Import the JSON file below to get started in no time.

ui-text-box
UI Expand
titleJSON


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": "Automatically close parent when all sub-tasks are done",
    "description": "",
    "creator": "admin",
    "status": false,
    "triggerData": "",
    "triggerType": "ISSUE_TRANSITIONED_EVENT",
    "configuration": {
        "refs": [
            "issue",
            "system",
            "trigger.issue",
            "trigger.parent"
        ],
        "triggerType": ""
    },
    "children": [
        {
            "sequence": 0,
            "type": "JQL_CONDITION",
            "ruleEntityType": "CONDITION",
            "configuration": {
                "refs": [
                    "issue",
                    "project",
                    "system",
                    "trigger",
                    "trigger.issue",
                    "trigger.parent"
                ],
                "jql": "issuetype in subtaskIssueTypes()",
                "jqlParsingMode": "jql",
                "actingUser": "field_00020"
            },
            "children": [
                {
                    "sequence": 0,
                    "type": "ISSUEBOOLEAN_SELECTORCONDITION",
                    "ruleEntityType": "SELECTORCONDITION",
                    "configuration": {
                        "refs": [
                            "issue",
                            "project",
                            "system",
                            "trigger",
                            "trigger.issue",
                            "trigger.parent"
                        ],
"option": "parent",
"issueListExpressionParsingMode": "issues",
                        "expression": "%{trigger.issue.status} = \"Done\" and count(siblingSubtasks()) = count(filterByStatus(siblingSubtasks(), \"Done\"))",
                        "expressionParsingMode": "logical",
                        "actingUser": "field_00020"
                    },
                    "children": [
                        {
                            "sequence": 0,
                            "type": "BOOLEANISSUE_CONDITIONSELECTOR",
                            "ruleEntityType": "CONDITIONSELECTOR",
                            "configuration": {
                                "refs": [
                                    "issue",
"issues",
"project",
"selector.issue",
"selector.parent",
"system",
"trigger",
                                    "project",
                                    "system",
                                    "trigger",
                                    "trigger.issue",
                                    "trigger.parent"
                                ],
"expression                                "option": "%{trigger.issue.status} = \"Done\"",
"expressionParsingModeparent",
                                "issueListExpressionParsingMode": "logicalissues",
                                "actingUser": "field_00020"
                            },
                            "children": [
                                {
                                    "sequence": 0,
                                    "type": "TRANSITION_ISSUE",
                                    "ruleEntityType": "ACTION",
                                    "configuration": {
                                        "refs": [
                                            "issue",
                                            "issues",
                                            "project",
                                            "selector.issue",
                                            "selector.parent",
                                            "system",
                                            "trigger",
                                            "trigger.issue",
                                            "trigger.parent"
                                        ],
                                        "option": "status",
                                        "status": "1000110012",
                                        "actingUser": "field_00020"
                                    },
                                    "children": null,
                                    "hasChildren": false
                                }
                            ],
                            "hasChildren": true
                        }
                    ],
                    "hasChildren": true
                }
            ],
            "hasChildren": true
        }
    ],
    "hasChildren": true
}




Related examples

Page properties report
headingsAutomated action, Use case description, ComplexityJWT feature, Label
cqllabel = "use-case-auto" and label = "addtransition-commentissue" and space = "JWTSDC"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue


JWT feature

Automated actionTransition issue action
Use case description

Automatically set parent issue to 

Status
colourGreen
titledone
after all sub-tasks are done.

Parser functions

count()

filterByStatus()

siblingSubtasks()

LabelLabelComplexity

Status
colourGreenRed
titleBeginnerStaff pick




Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titleto dodone

Style guide

Status
colourGreen
titledone

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