I have a number field (Cap) im looking at automation to enforce that this number field always has only two decimal places. Right now the default is 3. So in short i am looking for the three following scenarios
Cap: 25.536 becomes 2.54
Cap: 25 becomes 25.00
Cap: 25.2 becomes 25.20
Ive tried using the following smart value {{issue.Cap.format("###.##")}} when "Cap" field is changed, but am not having any luck.
Hi @Scott Federman ,
I'm Nithaya from the Automation team here at Atlassian. Did you manage to find a solution? I tested out ROUND suggested by @Mark Segall and it seams to work.
In your screenshot, it looks like you missed the second parameter:
{{#=}}ROUND({{issue.Cap}},2){{/}}
Did you try again with the second parameter?
Cheers,
Hi @Scott Federman - You probably want to use ROUND
{{#=}}ROUND({{issue.Cap}},2){{/}}
Not sure if the preceding/closing is required, but that's a copy/paste of what I've used in the past.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Mark Segall thanks again for your help. Unfortunately, that one didn't work:( I looked at the log and it says no change.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share a screenshot of the rule so I can get a better sense of what you're trying to accomplish?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You got me stumped on this one. Hopefully someone else in the community has a fresh perspective.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here is the solution I have found to limit the decimal places. I have tried and it worked fine.
We need to use the below smart values
"{{issue.<field name>.format(".#")}} - For upto 1 decimal place
{{issue.<field name>.format(".##")}} - For upto 2 decimal places
{{issue.<field name>.format(".###")}} - For upto 3 decimal places"
Thanks,
Pradeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.