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
Just following up to check if this answered your question. If so, please consider marking this one as "answered". That will help others with a similar need find solutions faster. If not, please let the community know what help you need with the rule changes.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.