Add two numeric field in issue by post function in workflow

Zawistowski Grzegorz October 4, 2015

How to add two numeric field in post function at workflow.

I must get a result:

numeric1 + numeric2 = numeric3

How could I achieve this in workflow ? Please help.

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2015

Sumit's answer gives you a script field on an issue.  This is a solution you've been told several times already, but ignored.

It does not happen in the workflow.  If you want to calculate a field in the workflow, then you need a post function (again, something you've been told several times before).

The question that you've refused to answer in other conversations remains what you actually want from this calculation.  Is a scripted field on an issue what you want?  Or a field you can edit after an initial calculation is made?  Or a field somewhere else?

Zawistowski Grzegorz October 5, 2015

Mayby that's why it dificult to understand JIRA in first time. So how could I sum in workflow by post function two numer filds ? I know I'm ashing very easy Question for You, but how could I do it ?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2015

Find or write a post-function to do it. You *still* need to tell us what you want from this field - you haven't answered the question about where you want it to appear.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2015

... or how it should behave. Read only or editable.

Zawistowski Grzegorz October 5, 2015

In the row it could be editable, but total it shouldn't be editable.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2015

That is not what you said on the other conversation. You said they should be read only. If you want them editable, then you need a post-function to calculate the value and put it in a field which the user can then change later. We've answered the total thing too - the navigator does not support that, you'll need an add-on.

0 votes
Sumit Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2015

Use calculated number field : 

 

formula should be 

<!-- @@Formula: (issue.get("customfield_XXXXX") != null ? issue.get("customfield_XXXXX") : 0) + (issue.get("customfield_XXXYZ") != null ? issue.get("customfield_XXXYZ") : 0) +(issue.get("customfield_XXXYZU") != null ? issue.get("customfield_XXXYZU") : 0) -->

 

it will work everywhere within JIRA [so no transition restriction will be applied]

XXXXX – ID of calculated number field which shown sum

XXXYZ – First Number field

XXXYZU – Second Number field

Zawistowski Grzegorz October 4, 2015

And this formulas are in workflows too ? How to learn Jira formulas ? Why You writing a lot != ? issue

Zawistowski Grzegorz October 4, 2015

Where Coul I put this formula in workflows ?

Zawistowski Grzegorz October 4, 2015

And You told about Workflows or about Misc fields ?

Zawistowski Grzegorz October 5, 2015

They shouldyn't be "ID of calculated number field which "

Zawistowski Grzegorz October 5, 2015

and Could I do calculations by Columns ?

Suggest an answer

Log in or Sign up to answer