How to access smart values for "Remaining Estimate" and logged work?

sdt April 28, 2020

The documentation on smart values is rather sparse:

For an automation job I've been trying to figured out how to use smart values to access the "remaining estimate" of an issue:

I tried {{issue.remainingEstimate}} but according to the Audit Log that results in an error?

Furthermore, I've been trying to add an automation rule which is triggered when a work log entry is created. I saw that there is a smart value called "fieldChange" that can be used for this purpose. But there's no example on how to use {{fieldChange.fromString}} and {{fieldChange.toString}}? I've been googling but I haven't found anything helpful so far.

3 answers

1 accepted

4 votes
Answer accepted
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2020

Hello @sdt 

Welcome to the community.

To access to the remaining time you need to use this smartvalue:

{{issue.fields.timeestimate}}

If you want to know how to access to a field use this api:

yourURL/rest/api/2/issue/issuekey

You will see all the fields and how they are named.

 

Here what i understand about the field change.

{{fieldChange.fromString}} : the value the field was holding before my i edite it

{{fieldChange.toString}} : the new value of my field

 

Hope this helps

sdt April 28, 2020

Thanks @Mohamed Benziane, your hints were quite helpful. I was able to access the remaining estimate value in the meantime, but strangely {{fieldChange.fromString}} and {{fieldChange.toString}} both return with empty values when I try to access the smart values after a work log entry is created

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2020

Can you show us your automation rule ?

sdt April 28, 2020

Bildschirmfoto 2020-04-28 um 13.25.54.png

and the value which I try to set for Remaining Estimate is:

{{issue.fields.timeestimate}} - {{fieldChange.fromString}} + {{fieldChange.toString}}

I checked the values of fieldChange.xxx with the audit log and they are empty

sdt May 1, 2020

After trial and error for several hours, I've found the solution:

The "remaining estimate" should be updated with the following expression:

{{#=}}({{issue.fields.timeestimate}} - {{worklog.timeSpentSeconds}}) / 60{{/}}

Note that the default unit for time tracking is minutes (=> check your Jira issue time tracking settings: https://<your instance>/secure/admin/TimeTrackingAdmin.jspa)

Like # people like this
sdt May 1, 2020

After trial and error for several hours, I've found the solution:

The "remaining estimate" should be updated with the following expression:

{{#=}}({{issue.fields.timeestimate}} - {{worklog.timeSpentSeconds}}) / 60{{/}}

Note that the default unit for time tracking is minutes (=> check your Jira issue time tracking settings: https://<your instance>/secure/admin/TimeTrackingAdmin.jspa)

Michael Anderson
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!
June 15, 2020

Hi sdt, I'm trying to recreate this workflow in my own project, but running into several errors. Would it be possible for you to share what code you have for each of your actions please?

 

Thanks!

sdt June 17, 2020

Hi Michael,

it was quite tricky, since I had to work around the issue that I couldn't use if-then-else condition with the plugin version I had installed. So I ended up creating 3 component blocks for the parent ticket. One with the condition that timeestimate > timeSpentSeconds, one with timeestimate = timeSpentSeconds and one with timeestimate < timeSpentSeconds.

For example one component blocks looks like this:

For Parent

the "if" conditions

First value: {{issue.fields.timeestimate}}
Condition: greater than
Second value: {{worklog.timeSpentSeconds}}

and then the "edit issue" action looks like:

 Choose fields to set: Remaining Estimate (System)
{{#=}}({{issue.fields.timeestimate}} - {{worklog.timeSpentSeconds}}) / 60{{/}}

I repeated that another 2 times as with "equals" and "less than" conditions.

Hope that helps?

Sabine

Like Michael Anderson likes this
vincenzo_spatafora
Contributor
September 6, 2024

Hi @sdt 

would you know as how to convert {{issue.fields.timeestimate}} in days or weeks?

Thanks, Vincenzo.

0 votes
vincenzo_spatafora
Contributor
September 6, 2024

Hi ALL,

would you know as how to convert {{issue.fields.timeestimate}} in days or weeks?

Thanks, Vincenzo.

0 votes
pedro_pizarro_bip July 28, 2022

Hi, I hope this topic page is correct.

I need to sum the logged time of the subtasks and report the result in the logged time of the story. So that the time tracking values of "remaining estimate" of the story will be updated automatically. I already have tried many automations but no one is working.

remaining-estimate-automation.GIF

Thanks for the answers

joehardin
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.
May 28, 2023

*sorry for a very late reply here but hopefully it helps others*

Pedro, 

What you are attempting to do looks exactly like the default behavior of jira so i don't see a need for automation. If you look at the field called "Σ Remaining Estimate" in issue search you'll see this field represented. 

Remaining estimates from subtasks automatically roll up to update the remaining estimate on the parent.

 

jira.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events