I'm using some back end queries which is more complex. But if this is feasible suing script runner plugin, please try it.
Normally you can use following calculation for defect density
defect density = (No of defects count) / (No of CR count)
Using this you can have defect density for each project or version/release.
If you have script runner plugin, you can use a scripted field for this. You need to write a JQL based on the filter conditions of cyclle time, status/resolution of issues, parse it and calculate the result. You can also display the result on the master ticket (Epic/Story).
Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...