On this page



Use case

When a custom "Number field" is changed in a sub-task, a corresponding field in the parent issue, representing the sum of those field values, will be automatically updated.

The rule executes every time the field is being updated on a sub-task.


Don't want to use an automation rule? Just take a look at JWT calculated number fields instead!




Field changed event



Add a Trigger → Field changed event


Fields

Choose your custom Number Field


Changed to

Choose Any value



Issue selector

Add SelectorIssue selector


Target Issue(s)

Choose Parent Issue

 Update field action

Next to the Issue Selector click on Add → ActionUpdate field


Field

Choose your custom Number Field


Update to

Choose Value returned by parsed expression


Parser Expression

Set the mode to Advanced text and enter the following Parser Expression

sum(fieldValue({issue.cf11502}, subtasks())) 
#Replace field code with the field code of your custom field. Use the field dropdown to automatically insert the field code


 {issue.cf11502} is the field code for the custom number field to be summed up. The field code will differ in your instance.








Screencast

This is how the configuration above should look on your screen

You can get the same result by configuring JWT calculated number fields.



Import the example

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



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": "Update summed up value in parent issue on field change in sub-tasks",
    "description": "",
    "creator": "admin",
    "status": true,
    "triggerData": "",
    "triggerType": "FIELD_CHANGED_EVENT",
    "configuration": {
        "refs": [
            "issue",
            "system",
            "trigger.issue",
            "trigger.parent"
        ],
        "fieldId": "12202",
        "option": "any",
        "triggerType": ""
    },
    "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": "UPDATE_FIELD",
                    "ruleEntityType": "ACTION",
                    "configuration": {
                        "refs": [
                            "issue",
                            "issues",
                            "project",
                            "selector.issue",
                            "selector.parent",
                            "system",
                            "trigger",
                            "trigger.issue",
                            "trigger.parent"
                        ],
                        "fieldId": "12202",
                        "mode": "parser",
                        "value": "sum(fieldValue({issue.cf12202}, subtasks()))",
                        "valueParsingMode": "math",
                        "sendMail": "true",
                        "actingUser": "field_00020"
                    },
                    "children": null,
                    "hasChildren": false
                }
            ],
            "hasChildren": true
        }
    ],
    "hasChildren": true
}




Related use cases




JWT feature

Automated action
Parser functions

fieldValue()

sum()

subtasks()

Label






Status
Tech review

Style guide