-
Suggestion
-
Resolution: Fixed
-
None
You need to account for the case where the jiraissue.issuestatus is null.
We had quite a large number of these - and in all cases, the worflow status was ok - so it was just a matter of updating jiraissue with the value from OS_WFENTRY
REPORT:
SELECT jiraissue.pkey, OS_WFENTRY.STATE, jiraissue.issuestatus FROM jiraissue INNER JOIN OS_WFENTRY ON jiraissue.WORKFLOW_ID = OS_WFENTRY.ID WHERE (jiraissue.issuestatus IS NULL) ORDER BY jiraissue.pkey;
FIX:
update jiraissue set issuestatus = ( select state from os_wfentry where id = workflow_id ) where issuestatus is null;
And pls make it efficient (no N+1 database calls...) - the other integrity checks are quite slow because of inefficient database access...