Moving ticket resolution duration metrics from JIRA into Confluence pages

I’m working on creating some performance reports and need to get ticket resolution duration information from JIRA into my Confluence documentation. Right now I can connect to JIRA from Confluence and pull basic stuff like ticket status and assignee details, which works fine.

The problem is I need to calculate and display the actual time it took to resolve tickets. Basically I want to show the difference between when a ticket was first created and when it got marked as resolved. I can see individual fields but can’t figure out how to get this calculated duration value.

Has anyone done something similar? I’m looking for a way to either pull this computed metric directly or get both timestamps so I can calculate the resolution duration myself. Any suggestions on the best approach would be really helpful.

Had this exact problem six months ago building quarterly dashboards. Here’s what worked: create a custom JQL query pulling both created and resolutiondate fields, then use a JavaScript snippet on the Confluence page to calculate the time difference. Set up the JIRA Issues macro to return those specific fields and auto-refresh. Make sure your JQL only filters resolved tickets - unresolved ones have null resolution dates and break everything. I formatted the output in business days instead of calendar days since management found that way more useful. Took about two hours to set up and it’s been rock solid since.

Here’s another approach that might work better - use the JIRA REST API directly in Confluence through user macros or custom HTML. I hit similar requirements building executive reports and found that pulling raw data through API calls gave me way more flexibility than the standard JIRA Issues macro. You can create a simple user macro that grabs the created and resolved timestamps via REST endpoints, then format the duration calculation however you want. The big advantage? You get better control over error handling when resolution dates are missing, plus you can batch multiple project queries efficiently. Takes more initial setup but scales much better if you’re planning to expand these reports later.

you can totally use the jira issues macro in confluence to grab both created and resolved dates. then just calc the difference in a new column or with some js. it worked fine for me on basic reports!