Good day,
I have a user who requested for a custom field Effort Variance. This field is essentially subtracting Time Spent (sys field) from Original Estimate (sys field). I am trying to use an automation rule instead of scriptrunner, I just want to see if its possible. The rule runs , but it always shows in a negative, even when its within the estimate. My rule is like this:

The action is to edit the Effort Variance field when the criteria is met. I tried using this expression:
{{#=}}({{issue.originalEstimate}} - {{issue.timeSpent}})/3600/8{{/}}d {{#=}}((({{issue.originalEstimate}} - {{issue.timeSpent}})/3600) % 8){{/}}h {{#=}}((( {{issue.originalEstimate}} - {{issue.timeSpent}}) % 3600) / 60){{/}}m
But this still gives me a negative even when the original estimate was set for 5w. The result needs to be something like 2w 3d 4h. See below eg :

Is there a way to use automation rules to achieve what I am looking for?
Will appreciate any guidance.
Thank you.