Hi Guys!
So, I'm working on a dashboard, and my goal is to get the average resolution time for a certain subset of work items.
I'm able to get Work Item Key, Created Date and Resolved Date, and to get the resolution time of each work item, I'm using a formula column as "date difference (Created at, Resolution at, Hour)".
With that, I'm getting the resolution time, in hours, for each work item.
Now comes the part I'm struggling with:
How do I get the average of this date difference, considering the number of work items being queried?
For example:
| Work item Key |
Created at |
Resolution at |
Datediff |
| WI-1 |
2025-10-27 15:27:35.144 |
2025-10-27 17:36:05.628 |
2 |
| WI-2 |
|
2025-10-28 19:03:04.621 |
27 |
| WI-3 |
2025-10-27 16:14:59.043 |
2025-10-29 15:44:10.926 |
47 |
I have 3 work items, and the resolution time for each of them is in the column Datediff.
The total resolution time would be 76h so the average would be 25.33h.
What I’m trying to figure out:
How can I calculate the average of the Datediff column directly in the SQL / query editor?
I can calculate the Datediff individually, but I’m struggling to compute the average across all returned rows within Atlassian Analytics.
Any suggestions on how to structure the query or use a nested query/CTE to achieve this?
Thanks in advance!