/** * Migrates given issue to new workflow and sets new status on it. * * @param issue issue to migrate * @param newWorkflow new workflow * @param status new status * @throws WorkflowException if migration fails */ public void migrateIssueToWorkflow(MutableIssue issue, JiraWorkflow newWorkflow, Status status) throws WorkflowException { final GenericValue issueGV = issue.getGenericValue(); migrateIssueToWorkflow(issueGV, newWorkflow, status != null ? ((StatusImpl) status).getGenericValue() : null); issue.setWorkflowId(issueGV.getLong("workflowId")); issue.setStatusId(issueGV.getString("status")); }
issue.setWorkflowId(entry.getId());
private void setNotCloningFieldsToBlankByDefault() { getIssueObject().setCreated(null); getIssueObject().setUpdated(null); getIssueObject().setVotes(null); getIssueObject().setWatches(0L); getIssueObject().setStatus(null); getIssueObject().setWorkflowId(null); // Ensure that the 'time spent' and 'remaining estimated' are not cloned - JRA-7165 // We need to copy the value of 'original estimate' to the value 'remaining estimate' as they must be kept in sync // until work is logged on an issue. getIssueObject().setEstimate(getOriginalIssue().getOriginalEstimate()); getIssueObject().setTimeSpent(null); //JRA-18731: Cloning a resolved issue will result in an open issue. The resolution date should be reset. getIssueObject().setResolutionDate(null); // If the user does not have permission to modify the reporter, initialise the reporter to be the remote user if (!isCanModifyReporter()) { getIssueObject().setReporter(getLoggedInUser()); } }