I have been reviewing the tables in JIRA Software trying to come up with a query to figure out how long issues had been in the different workflow states.
I can see the from/to states in the changeitem table and the start/finish dates in the OS_HISTORYSTEP and OS_CURRENTSTEP tables.
But the only way I can see to join these together is to match the changeitem groupid to the changegroup table's ID and then the changegroup's CREATED time to OS_*STEP tables' FINISHED_DATE.
Is there a better/easier way?