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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you show us your automation rule ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @sdt
would you know as how to convert {{issue.fields.timeestimate}} in days or weeks?
Thanks, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ALL,
would you know as how to convert {{issue.fields.timeestimate}} in days or weeks?
Thanks, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Thanks for the answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
*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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.