Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Logging time spent based on issue status with automation rule

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

1 answer

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

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

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

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.

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 :(

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)}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you