You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

On this page

Use case

Automatically close epic after all stories are done.


Issue transitioned event

Create a new rule and name it appropriately.

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

Add a Trigger → Issue transitioned event

JQL condition

Add the following:

type = "Story" and status = "Done"

Boolean condition

Next to the JQL condition click on Add → Condition → Boolean condition.

Add the following expression:

count(filterByStatus(issuesUnderEpic(%{trigger.issue.cf10001}), "Done")) = count(issuesUnderEpic(%{trigger.issue.cf10001}))

To achieve this, the following functions are used:

Issue selector

Next to the boolean condition click on  Add → Selector → Issue selector

Set the target issue(s) to issue list expression and add the following expression:

epic()

Transition issue

Next to the issue selector click on Add → Action → Transition issue

Set the mode to transition to status and done as the status

Enable the rule by clicking on the Enable button → 


Screencast

No screencast available at the moment.


Import the example

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

JSON

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.

{
    "name": "Close epic after all stories 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": "type = \"Story\" and status = \"Done\"",
                "jqlParsingMode": "jql",
                "actingUser": "field_00020"
            },
            "children": [
                {
                    "sequence": 0,
                    "type": "BOOLEAN_CONDITION",
                    "ruleEntityType": "CONDITION",
                    "configuration": {
                        "refs": [
                            "issue",
                            "project",
                            "system",
                            "trigger",
                            "trigger.issue",
                            "trigger.parent"
                        ],
                        "expression": "count(filterByStatus(issuesUnderEpic(%{trigger.issue.cf10001}), \"Done\")) = count(issuesUnderEpic(%{trigger.issue.cf10001}))",
                        "expressionParsingMode": "logical",
                        "actingUser": "field_00020"
                    },
                    "children": [
                        {
                            "sequence": 0,
                            "type": "ISSUE_SELECTOR",
                            "ruleEntityType": "SELECTOR",
                            "configuration": {
                                "refs": [
                                    "issue",
                                    "project",
                                    "system",
                                    "trigger",
                                    "trigger.issue",
                                    "trigger.parent"
                                ],
                                "option": "issueList",
                                "issueListExpression": "epic()",
                                "issueListExpressionParsingMode": "issues",
                                "actingUser": "field_00020"
                            },
                            "children": [
                                {
                                    "sequence": 0,
                                    "type": "TRANSITION_ISSUE",
                                    "ruleEntityType": "ACTION",
                                    "configuration": {
                                        "refs": [
                                            "issue",
                                            "project",
                                            "system",
                                            "trigger",
                                            "trigger.issue",
                                            "trigger.parent"
                                        ],
                                        "option": "status",
                                        "status": "10001",
                                        "actingUser": "field_00020"
                                    },
                                    "children": null,
                                    "hasChildren": false
                                }
                            ],
                            "hasChildren": true
                        }
                    ],
                    "hasChildren": true
                }
            ],
            "hasChildren": true
        }
    ],
    "hasChildren": true
}



If you still have questions, feel free to refer to our support team.