Dear All,
Am trying to convert the time logged in time tracking field into story points (and to capture them in the custom field with 2 decimal points)
Custom Field is Story Point Actuals
The reason for this conversion is to compare the Story point estimate field which is filled by the client and the story point actual (from the time log) and to see the SLA is breached or not.
But my current automation shows the result
45 minutes show as 0 h and 1 hour and 40 minutes show as 1h.
In the above for 3w 3d 7h logged the output should be 18.88 instead of 18.
Desired output:
The final output for 4h to show as 0.50 Story Points and 8h to show as 1.00 Story points and 10h to show as 1.25 Story Points.
Note: Where 1 week = 5 days and 1 day = 8 hours.
let me know if you need more info, happy to share.
Thanks in advance.
Regards,
Sabareesh
PS: script used:
{ "update": { "customfield_15178": [{ "set": {{issue.fields.timetracking.timeSpentSeconds.divide(3600).divide(8)}} }] } }
Have tried the below methods but it didnt workout.
divide(8).round(2){{/}}
divide(8).multiply(100).round(0).divide(100)
3600 / 8).toFixed(2)
Hello @Sabareesh Kumar M
Welcome to the Atlassian community.
Based on @Bill Sheboy 's answer in this post I recommend
{{#=}}ROUND({{issue.fields.timetracking.timeSpentSeconds}} / 28800, 2) {{/}}
I derived "28800" from multiplying 3600*8
I have confirmed that this gives a value of days with the decimal representing fractions of days.
Hi @Sabareesh Kumar M -- Welcome to the Atlassian Community!
Adding to Trudy's suggestions...
Even though I would not recommend converting time tracking to / from relative sizing measures (e.g., story points), the reason your inline math expression did not work is due to the value typing: integer versus decimal.
Specifically, the value timeSpentSeconds is an integer and that typing is preserved through the steps, leading to integer division and a value of 0 rather than a decimal value. When the longer form of math expression is used, the integer is converted with the division and a decimal is possible.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.