I want to calculate how much time the ticket took from creation to resolve using automation. I have used
{{issue.resolutiondate.diff(issue.created).hours}} Hours
smart value but after running the automation I am getting the negative result (ex -97 hours) even if the resolved date is after created date
What I'd do first is to ensure both {{issue.created}}
and {{issue.resolutiondate}}
have valid, properly formatted values. You can test this by logging these dates
Created: {{issue.created}}
Resolved: {{issue.resolutiondate}}
If the difference still shows as negative, it might be because the smart value's .diff()
method interprets the order incorrectly. You can use the .abs()
function to handle this or the other way around
{{issue.resolutiondate.diff(issue.created).hours.abs}} Hours
or
{{issue.created.diff(issue.resolutiondate).hours.abs}} Hours
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.