{"record":{"id":"903eec9de3ab7a34","repo":"theonedev/onedev","slug":"cannot-move-issue-0-as-it-has-already-been-mov","errorCode":null,"errorMessage":"Cannot move issue \"{0}\" as it has already been moved","messagePattern":"Cannot move issue \"(.+?)\" as it has already been moved","errorType":"http","errorClass":"NotAcceptableException","httpStatus":406,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/service/impl/DefaultIssueService.java","lineNumber":1146,"sourceCode":"\t\t\t\t\t\tdao.persist(clonedLink);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t\n\t\tlistenerRegistry.post(new IssuesCopied(sourceProject, targetProject, cloneMapping));\n\t}\n\t\n\t@Transactional\n\t@Override\n\tpublic void move(User user, Collection<Issue> issues, Project sourceProject, Project targetProject) {\n\t\tMap<Long, Long> numberMapping = new HashMap<>();\n\t\tList<Issue> sortedIssues = new ArrayList<>(issues);\n\t\tCollections.sort(sortedIssues);\n\t\tfor (Issue issue: sortedIssues) {\n\t\t\tcheckNoWorkspaces(issue, \"move\");\n\t\t\tif (issue.getMovedTo() != null) {\n\t\t\t\tthrow new NotAcceptableException(MessageFormat.format(\n\t\t\t\t\t\t\"Cannot move issue \\\"{0}\\\" as it has already been moved\",\n\t\t\t\t\t\tissue.getReference().toString(issue.getProject())));\n\t\t\t}\n\t\t}\n\n\t\t// Remember source identity so we can leave a bare stub after the move\n\t\tMap<Long, Issue> stubInfos = new LinkedHashMap<>();\n\t\tfor (Issue issue: sortedIssues) {\n\t\t\tIssue stubInfo = new Issue();\n\t\t\tstubInfo.setTitle(issue.getTitle());\n\t\t\tstubInfo.setState(issue.getState());\n\t\t\tstubInfo.setStateOrdinal(issue.getStateOrdinal());\n\t\t\tstubInfo.setProject(issue.getProject());\n\t\t\tstubInfo.setNumberScope(issue.getNumberScope());\n\t\t\tstubInfo.setNumber(issue.getNumber());\n\t\t\tstubInfo.setSubmitter(issue.getSubmitter());\n\t\t\tstubInfo.setSubmitDate(issue.getSubmitDate());\n\t\t\tstubInfo.setConfidential(issue.isConfidential());","sourceCodeStart":1128,"sourceCodeEnd":1164,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/service/impl/DefaultIssueService.java#L1128-L1164","documentation":"During move(), each issue is checked with checkNoWorkspaces and for a prior move; if issue.getMovedTo() is already set the issue was previously moved to another project and moving it again is not allowed. The message names the issue.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/service/impl/DefaultIssueService.java:1146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Skip issues whose movedTo is already set and follow the movedTo link to the new location.","Only move issues that have never been moved."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}