Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Can you add two values together to generate original and remaining time?

Stephen C Hauer
Contributor
April 15, 2022

Hey guys, 

Not sure Im doing this correctly but here we go. I want to have automation handle creating my original and remaining time estimates. Right now I can get time added into into original and remaining based on Team and Complexity of asset. This image show how that works

image.png

Next want Im trying to do is have time added to the original estimate when the user says the task needs to have compiling time. Here Im trying to add 1 day. 

image.png

However no matter what I do it never works. Is this type of automation not support? Meaning should I not have a automated value generate a value and then have another value try to add time to that value?

Any advice on the best way to handle this?

Oh thought I would add this as another level of clarity. I want to add these values together if they are values set
image.png

 

2 answers

2 accepted

1 vote
Answer accepted
Stefan Salzl
Community Champion
April 15, 2022

Hi @Stephen C Hauer 

What is the result after rule execution? Is audit log giving any information?

Furthermore:
Those fields take "amount of time" input (1d, 5h, etc....). As shown in your screenshot the rule calculates a a date as the smart value {{now}} returns the current date & time. What would you expect to be written into the field? If it´s "the current value of the field" (eg. original estimate) plus 1d then I would suggest using the smart value of its own (eg. {{issue.Original Estimate}}) and adding the time.

Best
Stefan

Stephen C Hauer
Contributor
April 15, 2022

I just tried the following and it fails. I was hoping by doing this it would add 1h to the current time in the estimated and remaining time fields. 
image.png
The error I currently get is as follow
image.png

Stefan Salzl
Community Champion
April 15, 2022

ok....finally I guess I found a way:

When logging original estimate it´s logged in seconds. strange (but true) seconds cannot be filled in when editting the field. Therefore:

  • getting current original estimate
  • dividing by 60 to get to minutes
  • adding minutes as needed (--> in my case I took 60 as in your example and multiply by a custom field (Number) so reflecting your use case --> in your case it would be "Asset-Variants")
  • adding the letter 'm' after the calculation so that in the edit action jira knows that it should add minutes
{{#=}}{{issue.Original Estimate.divide(60)}} + {{issue.Number 1.multiply(60)}} {{/}}m

See screenshot:

image.png

Hope this helps.

Best
Stefan

Stephen C Hauer
Contributor
April 15, 2022

That was it !!!! Thanks the formal I used was a bit smaller but its working now!!! Thank you so much for your help. To be clear 30 for me = minutes

image.png

Like # people like this
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.
April 15, 2022

Hi @Stephen C Hauer 

When setting those fields, you need to specify a value (with the default units of measure of Seconds) or specify the units of measure (e.g. 4h).

To add to the existing value, please try either form of the math expressions and add the units of measures to the end to see what happens.  For example to add one hour, convert to hours and then add the amount:

{{issue.Original Estimate.divide(3600).plus(1).concat("h")}}

Please note: if you are adding days and not hours, Jira will based that upon your site settings for working hours to translate "days".

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events