Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-40009

Prevent JIRA from creating duplicate draft workflows

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Expected Behaviour

      JIRA should automatically detect duplicated drafts of workflows and delete the duplicate.

      Actual Result

      When the creation of a duplicated draft of a workflow occurs in the database, trying to edit the workflow or create another draft results in 500 errors.

      Steps to reproduce

      It's not certain how to reproduce this or what exactly causes the duplication of the drafts.

      There's some hints on the cause being around concurrent uses of the workflows' editing feature. However, a test recently performed on our side returned no more than some 404 errors when two people were editing the same workflow.

      Diagnosis

      Run the below query to find out whether you have duplicated drafts or not and also what workflows are affected by this.

      SELECT
      	COUNT(*) AS	"# of Drafts",
      	parentname AS "Workflow",
      	MAX(id) AS "Duplicate" 
      FROM
      	jiradraftworkflows
      GROUP BY 
      	parentname 
      HAVING 
      	count(*) > 1;
      

      Workaround

      Run the below query to delete the duplicated drafts.

      Make sure you have an up-to-date backup of JIRA's database before performing any manual data manipulation.

      DELETE FROM jiradraftworkflows WHERE id IN (
      	SELECT max(id) FROM jiradraftworkflows GROUP BY parentname HAVING count(*) > 1)
      

      Attachments

        Issue Links

          Activity

            People

              ntran Nhat Tran
              takindele Taiwo Akindele (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

                Created:
                Updated: