Ciao a tutti,
sto lavorando con una regola di Jira Automation di Atlassian e ho un problema sulla gestione dei decimali quando converto i worklog in giorni.
Contesto
Ho un custom field numerico chiamato:
Residuo a finire
Lo stesso campo è presente sia sugli Epic sia sui Work Package.
La regola viene eseguita in branch sui worklog (For each worklog) e serve a scalare dal campo Residuo a finire dell’Epic (dalle Story - Epic è padre delle story) il tempo loggato, convertendo i secondi in giorni.
Formula usata
{{issue."Residuo a finire".asNumber.minus(worklog.timeSpentSeconds.divide(28800.0))}}
(1 giorno = 28.800 secondi)
Comportamento atteso
Se loggo:
4 ore (14.400 secondi)
mi aspetto che venga scalato:
0,5
dal campo Residuo a finire.
Comportamento reale
se loggo 1 giorno (28.800 secondi) → viene scalato correttamente 1
se loggo 4 ore → non viene scalato nulla (risultato 0)
Quindi le frazioni di giorno vengono perse.
Verifiche già fatte
Dettaglio importante
Sul Work Package, sul campo visivamente chiamato allo stesso modo (Residuo a finire), i decimali vengono visualizzati correttamente. Per il Work package (padre dell'epic) ho una regola diversa che fa il roll up e somma le epic.
Potete aiutarmi? Grazie
Your smart value expression is encountering value-type differences for inline math expressions versus long-format expressions. Please look here to see an article I wrote explaining that behavior difference:
The fix for your scenario is to use a long-format expression, and then add the ROUND() function to select the precision you want. To learn more, see examples of such expressions here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
Kind regards,
Bill
Ciao @Bill Sheboy io non voglio che il valore venga arrotondato ma che abbia anche i decimali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information, @Stefano De Santis
Please try the long-format of a math expression and observe the result. If you run into problems, please post the expression you are using and what is not working as expected.
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.