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

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 

Suggest an answer

Log in or Sign up to answer