2013-09-10

Jira: SQL for "Check workflow entry states are correct" integrity check

If this query returns any rows, run the "Check workflow entry states are correct" action in the Integrity Checker.
This issue happens as a result of the lack of using database transactions during the workflow transitions (which changes numerous tables) in Jira.
SELECT jiraissue.pkey, jiraissue.workflow_id, OS_WFENTRY.*
FROM jiraissue
INNER JOIN OS_WFENTRY ON jiraissue.workflow_id = OS_WFENTRY.id
WHERE OS_WFENTRY.STATE IS NULL OR OS_WFENTRY.STATE = 0;

Update: For JIRA version 6.x I suggest reading this: http://kozelljozsef.blogspot.com/2014/11/jira-check-workflow-entry-states-are-correct.html

2 comments :

  1. I've evolved it further: http://kozelljozsef.blogspot.hu/2014/11/jira-check-workflow-entry-states-are-correct.html

    ReplyDelete