-
Bug
-
Resolution: Fixed
-
Low
NOTE: This bug report is for JIRA Cloud. Using JIRA Server? 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)
- is related to
-
JRASERVER-40009 Prevent JIRA from creating duplicate draft workflows
- Gathering Impact