Email notification when logged work>= estimated time
Asked by Sven Olk:

Dear Atlassian community,

I?m looking for an Automation rule to send out an email notification when logged time in a ticket is \>= the initial estimated time. I tried with some smart values but I wasn?t successful yet.

Is there anyone with a helpful tip?

Thanks in advance  
Sven


Answers:
author: Darryl Lee
body: Over in **Related Community content** for this post I see this top link:

* [?original estimate ?Time spent usage](https://community.atlassian.com/t5/Automation-questions/original-estimate-Time-spent-usage/qaq-p/1416816)

That should do the trick.

![Screen Shot 2021-08-12 at 10.24.53 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/155758iC7A79CBAA5E95504/image-size/large?v=v2&px=999 "Screen Shot 2021-08-12 at 10.24.53 AM.png")

comments: author: Sven Olk
body: Hi [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322),  
thank you for the quick reply. I had also seen this post, but his requirement is different. I don't want to aggregate times and output them in a parent ticket, but send an email.  
I'm trying to do that via these parameters, but to no avail (sorry for the German words, hope you can understand it nevertheless).

![Unbenannt.png](https://community.atlassian.com/t5/image/serverpage/image-id/156104iD25F097B33128998/image-size/large?v=v2&px=999 "Unbenannt.png")  
Do you have any idea how else to solve this? What am I doing wrong?

Thanks in advance


author: Darryl Lee
body: Ah, sorry, you're right. You're not trying to sum-up child tickets.

So "ist gleich" means "equals"?

So **remainingEstimate** is not actually a valid Smart Value. I looked at the REST API for one of my tickets, and found that the field name is actually **timeestimate.**

You can do this too, and it is very useful:

https://**YOURSITE** .atlassian.net/rest/api/2/issue/**YOURTICKET**?expand=names

And in the response, I see:

```
    "aggregatetimeoriginalestimate": 3600,
    "timeestimate": 2700,
```

(Values are returned in seconds, so then, my original estimate was 60m, and I have 45m left on this ticket.)

Remaining Time/Estimate cannot be negative, so then the rule is actually pretty simple:

![Screen Shot 2021-08-16 at 10.55.36 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/156179i8164A7377087F3C0/image-size/large?v=v2&px=999 "Screen Shot 2021-08-16 at 10.55.36 AM.png")


author: Darryl Lee
body: Only tested this in Cloud, but it looks like at least in version 7.3.4 for Server, the field is also **timeestimate.**


author: Sven Olk
body: Hi [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322)   
Thank you for your information!  
I have now managed to create a good query/filter and that is that a mail will be sent if the effort of the remaining time is less than 20% of the original effort.  
Problem is that the rule does not take effect if the user documents the actual effort, but at the same time increases the remaining effort so that it is \>20% of the original effort.  
So I would like to combine the first if condition with another condition "field remaining time was edited". Can you tell me if and how this can be done?

Thanks in advance  
Sven

![Unbenannt.png](https://community.atlassian.com/t5/image/serverpage/image-id/156697i00CE68F340B6CC73/image-size/large?v=v2&px=999 "Unbenannt.png")