Trying to convert the timelog/worklog into story points and capture in custom field with 2 decimals

Sabareesh Kumar M
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2025

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.


jira.jpg

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)

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 14, 2025

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.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2025

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

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events