Problem with comparing durations

Alexander Makarovsky December 2, 2024

Hi there! I have a task to track when time spent by specific developer exceeds original estimate.
What I've done is created a custom field named "dev-total" using JCMF Calculated (scripted) Duration Field with formula:
employeeKey = issue.get("customfield_12116")?.key; worklogs = issue.get("worklog")?.findAll({it.authorKey == employeeKey }); return worklogs.sum(0, { it.timeSpent });

where customfield_12116 is a field where developer is assigned.
Field works perfectly fine.

Than I've created an automation rule with compare condition.
Screenshot 2024-12-03 at 0.09.54.png
And it doesn't work. It performs even if time spent by a developer is less than original estimate.

What am I doing wrong?

1 answer

1 accepted

3 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hello @Alexander Makarovsky 

As a debugging step you should print each of those smart values into the rule Audit Log so that you can see if the values being compared are what you expect.

You can print information into the Audit Log using the Log action in the rule.

Alexander Makarovsky December 2, 2024

Nice! Thank you!
I've done it and it seems {{issue.originalestimate}} returns nothing
Screenshot 2024-12-03 at 1.04.59.png

Alexander Makarovsky December 2, 2024

ok, now I understand. It was a simple mistake, since smart value for Original estimate should be issue.timetracking.originalEstimate
Problem solved.
Thank you so much!

Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer