Symptoms
The workflow integrity checker is timing out when running in the browser, preventing it from running.
Step-by-step guide
The SQL checks for workflows can be done by manually executing them against the database.
Workflow Entry States are Correct
This will check for any workflows that have an invalid state
Run SQL Command
SELECT
jiraissue.id issue_id,
jiraissue.workflow_id,
os_wfentry.*
FROM
jiraissue
JOIN
os_wfentry
ON
jiraissue.workflow_id = os_wfentry.id
WHERE
os_wfentry.state
IS
NULL
OR
os_wfentry.state = 0;
If this returns any records, for example below, they will need to be updated to be valid:
issue_id | workflow_id | id | name | initialized | state ----------+-------------+-------+------------------------------+-------------+------- 10023 | 10023 | 10023 | jdg-workflow-2-1377070570282 | | 0
To fix this example, run the following SQL - we need to update the
state
to be 1 based on theworkflow_id
. Theworkflow_id
is actuallyos_wfentry.id
.UPDATE
os_wfentry
SET
state = 1
WHERE
id = 10023;
JIRA Issues with Null Status
This will check if any issues have an invalid issue status
SELECT
jiraissue.id,
jiraissue.issuenum,
jiraissue.issuestatus,
jiraissue.project,
jiraissue.issuetype,
currentStep.step_id
FROM
jiraissue jiraissue
JOIN
os_currentstep currentStep
ON
jiraissue.workflow_id = currentStep.entry_id
WHERE
jiraissue.issuestatus
IS
NULL
;
And can be fixed with the following:
UPDATE
jiraissue
SET
issuestatus = (
SELECT
state
FROM
os_wfentry
WHERE
id = workflow_id)
WHERE
issuestatus
IS
NULL
;
Note : To reflect the changes JIRA restart is need.
Related articles