• We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      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...

            [JRASERVER-7428] Workflow Integrity Check needs an additional check

            Cool. Thanks.

            Nick Minutello added a comment - Cool. Thanks.

            I have added an integrity check that will populate the issue status if it is null. The state column of the OS_WFENTRY table is not actually an indicator of status, it is actually an active/inactive flag for the workflow entry and does not correspond to JIRA status. Instead we are getting the status by finding the workflow for the issues project/issue type and then getting the current step for the issues workflow id, resolving the step descriptor for that step, and getting the linked status for that step. This will resolve to the correct status.
            On the issue for efficiency we are selecting out the step id and issue information by joining the current step and jiraissue tables, we only resolve the status once per project/issue type and then we perform a bulk update of issues for each project/issue type combination.

            Dylan Etkin [Atlassian] added a comment - I have added an integrity check that will populate the issue status if it is null. The state column of the OS_WFENTRY table is not actually an indicator of status, it is actually an active/inactive flag for the workflow entry and does not correspond to JIRA status. Instead we are getting the status by finding the workflow for the issues project/issue type and then getting the current step for the issues workflow id, resolving the step descriptor for that step, and getting the linked status for that step. This will resolve to the correct status. On the issue for efficiency we are selecting out the step id and issue information by joining the current step and jiraissue tables, we only resolve the status once per project/issue type and then we perform a bulk update of issues for each project/issue type combination.

              dylan@atlassian.com Dylan Etkin [Atlassian]
              3b1ae0ec93c9 Nick Minutello
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: