Hi,
I'm attempting to assign a variable, varHours using a condition that converts the original estimate value (seconds) to hours -
{{issue.timetracking.originalEstimateSeconds.divide(3600)}}
This works ok except if the value is null, so have been attempting to have it default to 0, been trying a few things without success, think there is a div by zero error happening -
{{issue.timetracking.originalEstimateSeconds.divide(3600).round(0).default(0)}}
wondering if the best bet is the create a temp variable then use it to test for empty
Wider background to what I'm doing. I have another field called T-shirt-size that I'm using automation to set when the Original Estimate is set or changed. It runs some conditionals based on the value in hours, to work out s,m,l, & xl.
In my experience, the inline math operations do not consistently handle empty / null values well. As an alternative, perhaps use the longer format expression and add a 0 default value at the front:
{{#=}} ROUND( 0{{issue.timetracking.originalEstimateSeconds}} / 3600, 0) {{/}}
I added a ROUND function but you could remove that if you want a fractional value result.
Kind regards,
Bill
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.