Hi there community!
I´m trying to calculate the cumulative time that an issue has been flagged, but I´m not convinced with the values that I´m receiving.
Long story short, I´ve created a field called Idle Time to receive the time flagged in seconds and I'm trying to print the total value of this field as a comment. I´m using the issue.dueDate field to save the moment that the issue was flagged with {{now}}
This is the data that I´m using to populate the Idle Time:
{{#=}}{{issue.Idle Time}} + {{now.diff(issue.Due Date).Seconds.abs}}{{/}}
This is the data that I´m using to comment the issue after removing the flag:
{{issue.Due Date.diff(now.plusSeconds(issue.customfield_10198)).prettyPrint}}
This is the automation that I made:
The problem is that the value that I´m receiving in Idle Time Field seems to be wrong according to the time that the issue was flagged. For example, if I block the issue for 10 seconds, it display a crazy value like 39000 (milliseconds maybe?)
What am I missing here?
Hi @Rafael Pessoa -- Welcome to the Atlassian Community!
What you show will not work with the Due Date field: as Trudy describes that field is a date field and does not have the resolution of date / time.
With an automation rule, there are two ways I can think of to gather the cumulative time an issue was in a flagged condition, and both have limitations leading to possible measurement errors.
Kind regards,
Bill
Hi Bill, thank you for your answer!
I never thought to use comments as inputs but let´s give it a try.
I´ll create another field and test the solution with it. I´ll try to implement the second solution and post here so the community can also benefit from it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you get your solution to work?
Can you share the details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Rafael Pessoa
Welcome to the Atlassian community.
The built in Due Date field is a Date field, not a Date/Time field. When you set it to now() you get only the date. When you then use that in a date difference calculation it uses 00:00 as the Time.
You need to use a custom date/time type of field to record the moment the issue is flagged.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Trudy Claspill this explains a lot! I´ll change and post the results here so the community can also benefit from it.
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.