Jira Workflow Toolbox - sum with nested expression on linked issues

KM November 6, 2019

Hi All,

I know that Jira Workflow Toolbox has a capability to define custom field as calculated math function. Moreover this function can operate on a list of linked issues e.g.:

sum(fieldValue({16901}, linkedIssues()))

But I cannot find a way to define such calculated field as nested match expression operating on selected 2 fields of lined issues e.g.:

sum(fieldValue({16901}, linkedIssues())* fieldValue({16902}, linkedIssues()))

I need it to calculate total spending as as sum of (cost * rate) of all linked issues.

Is there any way to workaround that ?

1 answer

1 accepted

1 vote
Answer accepted
Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 7, 2019

Hi @KM ,

and welcome to the 'parser zone'. :)

Your scenario is actually rather easy using the mathOnIssueList() function.

If you can ensure that cost and rate are always set on your linked issues, you can use:

sum(mathOnIssueList(linkedIssues(), ^{16901} * ^{16902}))

 The failsafe approach would read:

sum(mathOnIssueList(linkedIssues(), (^{16901} != null AND ^{16902} != null) ? ^{16901} * ^{16902} : 0))

The second expression calculates the multiplication only for issues in which both values (cost and rate) are set and otherwise includes 0 in the total for this issue.

Cheers
Thorsten

KM November 12, 2019

Awesome. Tnx for your help.

KM

Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 12, 2019

You're welcome. Just as an additional note: if my explanation solved your problem, could you please mark the answer as correct?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events