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 ?
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
You're welcome. Just as an additional note: if my explanation solved your problem, could you please mark the answer as correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.