How do I specifically use Original Estimate for Value Changes trigger, instead of Time Tracking?
Asked by Dan H:

Hello we have a rule setup that sends out an email notification anytime a User modifies the Original Estimate field on a ticket while it's in an active Sprint.

The problem with this setup is that the only option available to select for this from the **Value Changes** trigger is **Time Tracking**. So of course frustratingly this will also send email notifications out anytime someone modifies the Remaining Estimate field too :(

![ValueChanges.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/127392i0783831DFBB5456D/image-size/large?v=v2&px=999 "ValueChanges.jpg")

So would like to know if it's possible to have this automation setup but ++only++ apply specifically for the **Original Estimate**field?

![FieldValue.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/127393iDE09CF4D17140DE6/image-size/large?v=v2&px=999 "FieldValue.jpg")


Answers:
author: Gareth Cantrell
body: Hi [@Dan H](/t5/user/viewprofilepage/user-id/1299555)

The *{{fieldChange}}* smart value which is set by the *Field value changed* trigger contains the following fields:

* field
* fieldType
* from
* fromString
* to
* toString

In the case of the *Time tracking* field, the field item will contain one of:

* timeestimate
* timeoriginalestimate

You can use these values in an Advanced compare condition to discover which time tracking field was changed as seen in the below image:

![Screenshot 2021-01-26 at 14.44.19.png](https://community.atlassian.com/t5/image/serverpage/image-id/127424i75AD7BE0148FC70B/image-size/large?v=v2&px=999 "Screenshot 2021-01-26 at 14.44.19.png")

comments: author: Dan H
body: Brilliant, thank you very much Gareth!

Appreciate the clear, easy to understand response as well as including screenshot : )


author: Dan H
body: [@Gareth Cantrell](/t5/user/viewprofilepage/user-id/3178836) Quick question, I use this condition in another very similar Rule but I'm getting in the logs that this doesn't appear to work if the Original Estimate is **blank** and then a value is entered (i.e. for new tickets created).

e.g. Original Estimate: ---\> Original Estimate: 2d

Then no actions performed as it fails this advanced condition.

So not sure if I'm missing something?


author: Gareth Cantrell
body: [@Dan H](/t5/user/viewprofilepage/user-id/1299555) if you're using a different trigger in your rule then the {{fieldChange}} smart value will not be set.

Could you attach a screenshot of your rule-chain view up to the point of the condition that's failing?


author: Dan H
body: Certainly!

So on a ticket if an Original Estimate value is **entered** for the first time, it will 'fail' the first condition below (No Actions Performed)

<br />

![Untitled.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/129556i02103A9078172ED3/image-size/large?v=v2&px=999 "Untitled.jpg")

So what I'm trying to achieve is the following;

If Original Estimate value is **entered** (if blank/zero) OR **changed** then continue with rule.

I've attempted to do this by creating a second Rule with: *timeoriginalestimate is greater than 0* (which works!) but now I've run into the problem of both Rules will successfully trigger anytime the **value is changed**:s


author: Gareth Cantrell
body: Hi [@Dan H](/t5/user/viewprofilepage/user-id/1299555)

In the rule where you want to check when the field is initially populated, you need to look for *{{fieldChange.field}}* equal to **timetracking**.

For checking when the original estimate is updated, you need to look for *{{fieldChange.field}}* equal to **timeoriginalestimate**.

This behaviour is peculiar to the time tracking field and you can see this by using the "Log action" component and setting the smart value in the log message.


author: Dan H
body: Thank you again [@Gareth Cantrell](/t5/user/viewprofilepage/user-id/3178836) this works!

Two separate rules setup to handle both those conditions;

![Untitled3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/129603iE6F03913BA0BFE11/image-size/large?v=v2&px=999 "Untitled3.jpg")

I did initially try to place both of these into ONE rule using If / Else block, but I failed to get that to work lol (screenshot below). What happens for me is that the second IF always fails, but I'm happy if this solution only works by creating two rule :)

![Untitled2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/129605iE283A6EC61836599/image-size/large?v=v2&px=999 "Untitled2.jpg")


author: Gareth Cantrell
body: I also noticed the else block would not evaluate the condition.

Probably worth raising a bug with Atlassian for this.


author: Iryna P.
body: [@Dan H](/t5/user/viewprofilepage/user-id/1299555) could you please share the formula in the "Edit issue field"? I can't find the right one to sum up Original Estimates of child issues


author: Daniel Ebers
body: Hi [@Iryna P.](/t5/user/viewprofilepage/user-id/1310189)

probably it would be better to ask a new question, unsure if many people will come back to this one here specifically after months having passed.

There is an example Automation rule which could get you started:  
<https://www.atlassian.com/software/jira/automation-template-library/rules#/rule/1371692/26233950>

You could have a look if it meets your needs. The above was an example back then, if I understood it right Dan wanted to send an mail in the end - probably as of now there is no formula for "edit" behind it for him.

Regards,  
Daniel


author: Dan H
body: [@Iryna P.](/t5/user/viewprofilepage/user-id/1310189) Certainly, this is what I use as the Edit Issue field:

Action: **Edit Issue**

Field: **Original** **Estimate**

Value: **{{#=}}{{issue.subtasks.original estimate.sum}} / 3600{{/}}**

*** ** * ** ***

Like so:

![edit.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/179469i8D3D5F206BE3593F/image-size/large?v=v2&px=999 "edit.jpg")


author: Aron Kuch
body: Very interesting how a field is stored in seconds, and when you sum it and put the result in the same field, it assumes the inserted value is hours, and so you have to divide by 3600. (eyeroll)


author: James
body: Now how do you use this value in conjunction with another operator?

{{issue.Start Date.plusDays(issue.original estimate/21600)}}


author: Erik Schweighofer
body: How could I access the changed field values (to/from) when **BOTH timeestimate and timeoriginalestimate**did change when editing an issue?

tried:

{{#changelog.timestimate}}{{from}} -\> {{to}}{{/}}

{{#changelog.timeoriginalstimate}}{{from}} -\> {{to}}{{/}}

shows nothing.


Tags: email

estimate

notification

time-tracking