My task was to display the time spent in each status like this (3 days 2 hours 11 minutes). I created a trigger that wrote down the "Last status change" custom field whenever the status changed.
Command: {{now}}
I created a trigger and a custom field for each state, but got stuck on the calculation.
Command:
{{issue.Time of entry into new status.diff(now).days}} days
{{issue.Time of entry into new status.diff(now).hours.mod(24)}} hours
{{issue.Time of entry into new status.diff(now).minutes.mod(60)}} minutes
The output I get is (1 days hours minutes) it only shows days
Please tell me where I went wrong or how this can be implemented.
And I apologize that my screenshots are in Russian, I hope this does not interfere
Rather than manually building that human-readable expression, please use the diff() function with the prettyPrint format: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-difference---
For example:
{{issue.some start datetime.diff(issue.some end datetime).prettyPrint}}
And...I believe there is no built-in modulo / mod function for automation rules.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.