Skip to end of metadata
Go to start of metadata

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

  1. Run SQL Command 

    SELECTjiraissue.id issue_id,
           jiraissue.workflow_id,
           os_wfentry.*
    FROMjiraissue
    JOINos_wfentry
    ONjiraissue.workflow_id = os_wfentry.id
    WHEREos_wfentry.state ISNULL
    ORos_wfentry.state = 0;
  2. 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
  3. To fix this example, run the following SQL - we need to update the state to be 1 based on the workflow_id. The workflow_id is actually os_wfentry.id.

    UPDATE os_wfentry SET state = 1 WHERE id = 10023;

JIRA Issues with Null Status

    1. This will check if any issues have an invalid issue status

             jiraissue.issuenum,
             jiraissue.issuestatus,
             jiraissue.project,
             jiraissue.issuetype,
             currentStep.step_id
      FROMjiraissue jiraissue
      JOINos_currentstep currentStep
      ONjiraissue.workflow_id = currentStep.entry_id
      WHEREjiraissue.issuestatus ISNULL;
    2. And can be fixed with the following:

      UPDATEjiraissue
      SETissuestatus = (SELECTstate
                            FROMos_wfentry
                            WHEREid = workflow_id)
      WHEREissuestatus ISNULL;

 

Note : To reflect the changes JIRA restart is need.