How do I query OS_HISTORYSTEP when jira issue has been moved, and its workflow_id has changed.

David Paul
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2012

I have seen a number of posts that state that to get the history for a particular jira, then you can run the following SQL.

select ACTION_ID from OS_HISTORYSTEP where ENTRY_ID=(select WORKFLOW_ID from jiraissue where pkey='TP-1');

However, if the jira was moved, the WORKFLOW_ID has also been changed, and so the history prior to the move is lost.

I assume that there is an association file to which I can find all historical WORKFLOW_ID's for a given jiraissue, but am not able to find it.



(note: I am looking for a sql solution, not a method that can be run to find the correct workflow_id)
Thanks.

David

1 answer

1 accepted

3 votes
Answer accepted
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2012
Did you check, if the change of workflowid is recorded in table changeitem? There should be a changeitem for the field workflowid or workflowId. You can join jiraissue and changegroup by jiraissue.id and changegroup and changeitem by changegroup.id to get all changeitems and thus get all workflowid changes. Please also check http://confluence.atlassian.com/display/JIRA041/Database+Schema#DatabaseSchema-ChangeHistory for more information about these two tables
David Paul
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2012

Thanks Dieter.

That is exactly what I was looking for. I appreciate it.

Suggest an answer

Log in or Sign up to answer