Hello,
I would like to update time spent on issue with automation rule,
based on the issue status:
If the status is "In progress" time spent should be 50% from the original estimate
and if the status is Done - 100% of original estimate.
I've tried the following in advanced edit issue action:
{
"update": {
"worklog" : [
{
"add": {
"timeSpent" : "{{issue.fields.originalEstimate.divide(2)}}d"
}
}
]
}
}
and got this error: (Invalid time duration entered. (worklog_timeLogged))
Any idea how to use smart value/JSON for this use case?
Thanks
Hi @Meital Adir
What problem are you trying to solve by doing this?
People use Jira work logging to record the actual time working on an issue. That actual time can be later compared to original estimates for various purposes.
If you are just recording the time based upon status transitions, it seems like you are using the feature as a percent complete indicator, or as something like "standard task times" for billing only.
Best regards,
Bill
Hi,
I'm looking for a way to use it as a percent complete indicator to present it in a report. The team will not record the actual time working so I'm looking for a way to automate it and create a report.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Meital Adir
It looks like your update JSON looks correct (other than that stray "d" character), and the smart value for original estimate is the error. Please try {{issue.timeoriginalestimate}} for single issues or for issues which have children try {{issue.aggregatetimeoriginalestimate}}
One challenge with automation if learning the correct smart value for a field. This how-to article shows a technique to find the smart values when you are unsure:
https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/
__Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy
Actually I've been trying a few hours and the issue now is how to divide the original estimate into half - in order to log work that is 50% from the remaining estimate.
I'm using smart value for the log work action:
(we're estimating in days)
{{#=}} {{issue.original estimate}}*0.5 /14400{{/}}
The problem is that I get the total number of days (same as remaining/original) and not half of it as I need.
I've tried also this {{#=}} {{issue.original estimate.divide(2)}} /14400{{/}} or {{#=}} {{issue.original estimate.sum}}*0.5 /14400{{/}} (also without /14400) and I keep getting the same estimate value and not half of it.
can you tell what's wrong in the formula?
Thanks,
Meital
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The .divide(2) will definitely work, and I suggest you check your site settings for the definition of working day to see if that is the problem with what you are seeing.
When you enter values in original estimate, the working day is used; it isn't a raw number...no matter how you enter it.
For example, my work-day set up is Monday-Friday and 8 hours long. If I enter 40h in original estimate, it converts that to 1w for display but stores 144000 seconds. If I had entered a value like 1w 3d, it would use working days and hours to convert that to 230400 seconds.
My suggestion is to confirm your working days and hours, and divide the seconds amount to get days, and then divide that by 2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the quick response @Bill Sheboy , our settings of working days and hours are the same - 8 hours a day, 5 days a week. and I still get the same number, seems like I can't divide that by 2 :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's curious. If you write the value to the audit log, what value do you see?
When I did this, the division worked: {{issue.Original estimate.divide(2)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get the value of the original estimate - for 1d in original estimate I got 14400 in the audit log. here is the rule
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try removing the math operators and just use the smart value, divided by 2. That worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now it's working for me when I use hours and change the default time tracking settings to hours. This is the value I used: {{#=}}{{issue.original estimate.divide(3600)}} /2 {{/}}
Thanks Bill!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.