I have a JQL with me. Lets say "project = XXX ORDER BY ID desc" which returns some issues from it. Here for say, 15 issues pulled out from the JQL. Out of 15 issues 9 are in Completed state. I want the average time between the Open and completed state of those 9 issues alone. If issues may be reopened and complete. In that case, it should be not take the time between Reopened and In progress. At the end the actual amount of time taken to complete an issue only taken into consideration and need the average cycle time from open to complete. In what way we can achieve this. Any API available Or If we have any SQL queries are also fine to go with.