Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I'm trying to format a text field they way Jira Tempo does in the field Original estimate ()
I have a smart value named billable that gives me the amount of seconds:
295800s --> 1w 5d 2h 10m
{{#=}}floor({{billable}} / (5 * 8 * 60 * 60)){{/}}w {{#=}}floor(({{billable}} % (5 * 8 * 60 * 60)) / (8 * 60 * 60)){{/}}d {{#=}}floor(({{billable}} % (8 * 60 * 60)) / (60 * 60)){{/}}h {{#=}}floor(({{billable}} % (60 * 60)) / 60){{/}}m
so that works fine.
The next step is to show only weeks, days and hours if the smart value is big enough. So therfore I try to use the .gte(x) or .gt(x) none of them seem to work:
"{{billable}}" --> "295800"
{{#if(billable.isNumeric())}}true{{/}} --> true
{{if(billable.gt(2), 1, 0)}} and {{if(billable.gt(2.0), 1, 0)}} --> 0
{{if(billable.lt(2), 1, 0)}} and {{if(billable.lt(2.0), 1, 0)}} --> 0
{{#if(billable.gte(2))}} 1 {{/}} --> empty
Hi @André
The math functions like gt() only work on numbers (and supposedly dates / time numeric values). Have you confirmed "billable" is a number type rather than text representing a number? The function isNumeric() only tests if the value contains only numbers, but not that is is a number type.
You could validate that by adding asNumber conversion in one of those expressions to observe any changes.
And for the scenario you are trying to solve, you may want to try created variables to store the intermediate values and make the checks easier later. For example, computing the number of weeks first.
Kind regards,
Bill
@Bill Sheboy Thanks a lot. That helped.
Sitll weird for me to do multiple math actions before that smart value to then having a MUST to do a asNumber conversion in ordert to use a .gte(x) or .gt(x)
The Atlassian Team, like @stas should really do an update for that docu. I would never get the idea to that alone :-|
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.