The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How Can I set value 0 if a Transition Count Field is Empty ?

ldogangul
March 28, 2018

My case is adding two custom fields and write it down on a third custom field.

My sum formula is: 

<!-- @@Formula: ((issue.get("customfield_12107")) + (issue.get("customfield_12108"))) -->

where customfield_12107 is a transition count field.

 

If transtion count field is filled during transitions the formula works, but if transition count field is not filled (if its null)   the formula does not work. 

How my I set 0 value if the transition count field is NULL   ??

Any help will be appreciated.

Levent

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
David Fischer
Community Champion
March 29, 2018

You should always protect your formulas against null values:

<!-- @@Formula: (issue.get("customfield_12107") == null ? 0 : issue.get("customfield_12107")) + (issue.get("customfield_12108") == null ? 0 : issue.get("customfield_12108")) -->
ldogangul
March 29, 2018

Hi David,

 

You are a real lifesaver. It work like a charm.

Wish you the best.

Levent.

ldogangul
September 27, 2018

Hi David,

I have aonther problem opened very newly, Can you help me to overcome whit it ? 

I can not send you the link of my question, could you find it under my profile ? The one ask for customfield to be calculated for just one project..

 

Thanks in deed.

Levent