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

Issue 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

JQL condition

UI Step

Add the following expression:

Code Block
languagebash
linenumberstrue
issuetype in subtaskIssueTypes()


Boolean condition

UI Step

Next to the JQL condition click on Add → Boolean condition

UI Steps


UI Step

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.




Issue selector

UI Step

Next to the Boolean condition click on Add → Issue selector

UI Steps


UI Step

Choose Parent issue as the target issue.



Transition issue

UI Step

Finally, next to the 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 Expand
titleJSON


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": "BOOLEAN_CONDITION",
                    "ruleEntityType": "CONDITION",
                    "configuration": {
                        "refs": [
                            "issue",
                            "project",
                            "system",
                            "trigger",
                            "trigger.issue",
                            "trigger.parent"
                        ],
                        "expression": "%{trigger.issue.status} = \"Done\" and count(siblingSubtasks()) = count(filterByStatus(siblingSubtasks(), \"Done\"))",
                        "expressionParsingMode": "logical",
                        "actingUser": "field_00020"
                    },
                    "children": [
                        {
                            "sequence": 0,
                            "type": "ISSUE_SELECTOR",
                            "ruleEntityType": "SELECTOR",
                            "configuration": {
                                "refs": [
                                    "issue",
                                    "project",
                                    "system",
                                    "trigger",
                                    "trigger.issue",
                                    "trigger.parent"
                                ],
                                "option": "parent",
                                "issueListExpressionParsingMode": "issues",
                                "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": "10012",
                                        "actingUser": "field_00020"
                                    },
                                    "children": null,
                                    "hasChildren": false
                                }
                            ],
                            "hasChildren": true
                        }
                    ],
                    "hasChildren": true
                }
            ],
            "hasChildren": true
        }
    ],
    "hasChildren": true
}




Related examples

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


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue


JWT feature

Automated actionTransition issue action
Parser functions

count()

filterByStatus()

siblingSubtasks()

Label

Status
colourRed
titleStaff pick




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