Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-65587

Cloning issues with several subtasks causes multiple copies of the issue

    XMLWordPrintable

Details

    Description

      Summary

      When cloning a ticket in JIRA, if it has several subtasks, multiple clones of it will be created as well as clones of the subtasks. Also, not all subtasks will be cloned, so deleting the other extra clones doesn't provide the same result as cloning should provide.

      The number of clones it will create seems to vary depending on the instance and number of subtasks, but we were able to get 2 or 3 clones instead of the expected 1 clone. This doesn't happen when not including subtasks or when the ticket has only a few subtasks.

      Tests in a clean instance show:

      1. Cloning a parent ticket with 151 subtasks: the parent is cloned twice
        • In this test, the subtasks for first parent clone were all cloned while for the second parent, only 42 were cloned
      2. Clone a parent ticket with 500 subtasks: resulted in three clones
        • Parent clones had this number of cloned subtasks: 500, 184 and 323

      Not always do a parent clone have all its subtasks cloned, though.

      Steps to Reproduce

      1. Create a ticket
      2. Add several subtasks to it (say 150 or 500)
        • It's possible to use a script that adds the tickets via REST API
      3. Clone the parent

      Expected Results

      The parent and all subtasks are cloned only once.

      Actual Results

      The tickets are cloned more than once and we see these errors in the JIRA logs:

      2017-02-02 18:33:52.135789500 2017-02-02 18:33:52,134 Caesium-1-3 ERROR sysadmin     [c.a.j.bc.issue.CloneIssueRunner] While executing 10301 identified task to be in state FAILED
      2017-02-02 18:33:52.135790500 com.atlassian.jira.task.progress.ZombieException: While executing 10301 identified task to be in state FAILED
      2017-02-02 18:33:52.135791500       at com.atlassian.jira.task.progress.ProgressUpdateWriterImpl.checkCorrectTaskStateToUpdate(ProgressUpdateWriterImpl.java:75)
      2017-02-02 18:33:52.135791500       at com.atlassian.jira.task.progress.ProgressUpdateWriterImpl.setProgressAsPercent(ProgressUpdateWriterImpl.java:46)
      2017-02-02 18:33:52.135796500       at com.atlassian.jira.task.progress.ProgressUpdateWriterImpl.setProgressAsRatio(ProgressUpdateWriterImpl.java:52)
      2017-02-02 18:33:52.135796500       at com.atlassian.jira.bc.issue.CloneIssueRunner.cloneSubTasksIfNeeded(CloneIssueRunner.java:494)
      2017-02-02 18:33:52.135797500       at com.atlassian.jira.bc.issue.CloneIssueRunner.cloneIssueDependencies(CloneIssueRunner.java:252)
      2017-02-02 18:33:52.135799500       at com.atlassian.jira.bc.issue.CloneIssueRunner.runTask(CloneIssueRunner.java:169)
      2017-02-02 18:33:52.135799500       at com.atlassian.jira.task.progress.ProgressAwareMessageRunner.processMessage(ProgressAwareMessageRunner.java:87)
      2017-02-02 18:33:52.135799500       at com.atlassian.messagequeue.internal.scheduler.SchedulerMessageRunnerService$AmqJobRunner.processNestedMessage(SchedulerMessageRunnerService.java:206)
      2017-02-02 18:33:52.135803500       at com.atlassian.messagequeue.internal.scheduler.SchedulerMessageRunnerService$AmqJobRunner.runJob(SchedulerMessageRunnerService.java:163)
      2017-02-02 18:33:52.135803500       at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:179)
      2017-02-02 18:33:52.135804500       at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:152)
      2017-02-02 18:33:52.135805500       at com.atlassian.scheduler.core.JobLauncher.launchJob(JobLauncher.java:135)
      2017-02-02 18:33:52.135806500       at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:126)
      2017-02-02 18:33:52.135806500       at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:487)
      2017-02-02 18:33:52.135807500       at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJob(CaesiumSchedulerService.java:461)
      2017-02-02 18:33:52.135808500       at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJobWithRecoveryGuard(CaesiumSchedulerService.java:466)
      2017-02-02 18:33:52.135809500       at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:412)
      2017-02-02 18:33:52.135812500       at com.atlassian.jira.scheduler.JiraCaesiumSchedulerService.executeQueuedJob(JiraCaesiumSchedulerService.java:81)
      2017-02-02 18:33:52.135813500       at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:65)
      2017-02-02 18:33:52.135813500       at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:59)
      2017-02-02 18:33:52.135815500       at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:34)
      2017-02-02 18:33:52.135815500       at java.lang.Thread.run(Thread.java:745)
      

      Workaround

      If any of the clones had all their subtasks cloned, delete the others and use this one.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jsilveira Jaime S
              Votes:
              9 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: