I have a simple Automation for a Sub-tasks:
If someone created a sub-task and sets there an 'Original Estimate', then this value is subtracted from Parent's 'Original Estimate'
Edit issue field have formula:
{{#=}}({{issue.fields.timetracking.originalEstimateSeconds}} - {{triggerIssue.timetracking.originalEstimateSeconds}}) / 60 {{/}}
And here is the screen of the rule:

It works OK, but I'm facing two problems:
1. As far as i understood, Time Tracking field (and in this case - trigger) consisting of 2 indistinguishable fields 'Original Estimate' and 'Remaining Estimate'. So my rule triggers every time anyone editing any of those two.
2. Anytime anyone EDITS Original or Remaining Estimates the whole script is executed!
Lets say parent's task Original Estimate is 5 hours, we create a sub task and set there original estimate 1 hour. This triggers automation which adjusts estimate 5-1 = 4 hours for Parent. Sub-task took 1 hour from a 'budget'. Sum is 1 + 4 = 5 hours as it was originally estimated and planned.
But is someone decided to change (edit again) Sub-task original estimate to 1h 30m, the whole script will run again and we getting 4 - 1.5 = 2.5 hours. So 1 hour is lost, if someone will edit 'remaining estimate' time even by 1 minute, we will get 2.5 - 1.5 = 1 hour... Etc.
I need a way to either IF-rule to branch 1st adjustment for every sub-task and then block any new edits. Or use old original estimate with formula something like:
{{#=}}({{issue.fields.timetracking.originalEstimateSeconds}} - {{triggerIssue.timetracking.originalEstimateSeconds}} + {{triggerIssue.timetracking.originalEstimateSeconds_PREVIOUS VALUE}}) / 60 {{/}}
In a first run it will be 0, in our case:
5-1+0= 4 For parent and 1 for Sub, 5 total.
and Later 4-1.5+1= 3.5 for parent and 1.5 for Sub, 5 total.
Also i need to reject/ignore this automation if someone playing with {{issue.fields.timetracking.remainingEstimateSeconds}}
Any ideas? 