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

StatuscolourRedtitleMaybe we should also create an example with a calculated number field and link them



When the 'Number field' custom field

When a custom "Number field" is changed in a sub-task,

the

a corresponding field in the parent issue, representing the sum of those field values,

gets updated with the updated result.

will be automatically updated.

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

UI Text Box
sizemedium
typeinfo

Use case

In the following example we want to display in the parent issue the sum of a number field in sub-tasks. So as soon as the value in a sub-task changes, the parent value will also automatically be updated.

Page properties
hiddentrue
Function

<link to function being used>

Use case description
Complexity

Status
colourGreen
titleBeginner


UI Text Box
typetip

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




UI Steps

Image Modified

 

Field

Changed Event

changed event

UI Step

Create a new rule and name it appropriately.

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

UI Text Box
typetip

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



UI Step

Add a trigger and choose the Field Changed Event Trigger → Field changed event

UI Steps


UI Step

Fields

Choose your custom Number Field

in Fields* and Any value in Changed to* text-box


ui-
typeinfo

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

Image Removed Issue Selector
step

Changed to

Choose Any value



Image AddedIssue selector

UI Step

Add SelectorIssue Selectorselector


UI Step

Target Issue(s)

*

:

Choose

Parent Issue

Image Modified Update

Field

field action

UI Step

Next to the Issue Selector click on Add → ActionUpdate Fieldfield

UI Steps


UI Step

Field

Choose your custom *:Number Field


UI Step

Update to

Choose*: Value returned by parsed expression


UI Step

Parser Expression

*

Set it the mode to Advanced text and use enter the following expression: Parser Expression

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


UI Text Box
typenote

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





UI Step

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

Activate the rule by clicking on the Activate rule button Image Removed → Image Removed




Image ModifiedScreencast

This is how the configuration above should look on your screen

Multimedia
nameupdate_summed_up_value_in_parent_issue_on_field_changed_in_sub-task.mp4
width700

UI Text Box
typetip

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



Image ModifiedImport 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": "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
}




Image AddedRelated use cases

Page properties report

Related examples

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


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue


JWT feature

Image Added

Automated action
Parser functions

fieldValue()

sum()

subtasks()

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