How to get a numerical value and convert it to hours?

Sam June 17, 2024

Hi All, 

I am trying to copy a numerical value from the story over to the sub-task issue and have that convert to hours.  

If the story's LOE field is updated -> copy that number to the subtask in hours over to the Original estimate field. 

Here is my rule, but I am only getting errors and no results whatsoever:

 

Copy LOE to Sub-Task in Hrs.jpg

1 answer

1 accepted

0 votes
Answer accepted
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.
June 17, 2024

Hi @Sam 

The smart value in your edit is incorrect.  If you want the field from your custom field, use only the trigger issue prefix: 

{{triggerIssue.yourfield}}

Next, the remaining syntax of your field edit is puzzling.  What are the name and type of the field in your Story?  The syntax you show looks more like a cascading field rather than a numeric field.

If it is just a number, there is no need for the sum as it is just a number.

Kind regards,
Bill

Sam June 17, 2024

This seems to work, but it defaults my time entered on the original estimate to min. How can I convert this to hours? 

So far I have tried this, but no luck: 
 

{{#=}}{{triggerIssue.LOE.divide(60)}}

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.
June 17, 2024

What are the units of measure of your source, custom field: seconds, minutes, etc.

My understanding is the built-in, time tracking values, available to rules, are in seconds.  When you divided by 60 that gives a value in minutes.

And so you could divide by 3600 instead or add a units of measure of h (for hours) at the end of setting the field.

Sam June 17, 2024

Hi, it defaults to minutes. I have tried the below, but still get no results. I would like to get the LOE which is a number convert to hours. Please let me know where I am wrong:

{{#=}}{{triggerIssue.LOE.divide(3600)}}

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.
June 17, 2024

You may either:

Add an h at the end to set as hours, or

Enter the number in the original estimate as seconds and it will convert correctly.

Sam June 20, 2024

This did the trick:
from number to hours. 
{{#=}}{{triggerIssue.LOE}} * 60{{/}}

your first answer though help me get to this place. Thanks

Suggest an answer

Log in or Sign up to answer