private Issue createTempIssue(Long id, Long projectId) { final MutableIssue issue = issueFactory.getIssue(); issue.setProjectId(projectId); return issue; }
MutableIssue validateAndSetProject(MutableIssue issue, IssueInputParameters issueInputParameters, Map<String, Object> fieldValuesHolder, ErrorCollection errorCollection, I18nHelper i18n) { issueCreationHelperBean.validateProject(issue, new OperationContextImpl(IssueOperations.CREATE_ISSUE_OPERATION, fieldValuesHolder), issueInputParameters.getActionParameters(), errorCollection, i18n); if (!errorCollection.hasAnyErrors()) { issue.setProjectId(issueInputParameters.getProjectId()); } return issue; }
public MutableIssue getIssueObject() { if (getIssueObjectWithoutDatabaseRead() == null) { MutableIssue issue = super.getIssueObject(); issue.setParentId(getParentIssueId()); issue.setProjectId(getPid()); } return getIssueObjectWithoutDatabaseRead(); }
protected MutableIssue getIssue() { if (issue == null) { issue = issueFactory.getIssue(); } issue.setProjectId(getProject().getId()); issue.setIssueTypeId(getIssueTypeObject().getId()); return issue; }
public MutableIssue getIssueObject() { if (getIssueObjectWithoutDatabaseRead() == null) { setIssueObject(issueFactory.getIssue()); // Most calls using the issue object will fail unless the issue object has the project and issue type are set getIssueObject().setProjectId(getPid()); getIssueObject().setIssueTypeId(getIssuetype()); } return getIssueObjectWithoutDatabaseRead(); }
public RemoteField[] getFieldsForCreate(User user, String projectKey, Long issueTypeId) throws RemoteException { //JRA-13703: Need to have the user available in the authenticationContext, such that fields // can carry out permission checks. final User oldUser = setRemoteUserInJira(user); try { if (issueTypeId == null) { throw new RemoteValidationException("The issue type must be specified"); } Project project = projectManager.getProjectObjByKey(projectKey); if (project == null || !permissionManager.hasPermission(Permissions.CREATE_ISSUE, project, user)) { throw new RemotePermissionException("You do not have create permission for this project."); } MutableIssue issue = issueFactory.getIssue(); issue.setProjectId(project.getId()); issue.setIssueTypeId(issueTypeId.toString()); return soapUtilsBean.getFieldsForCreate(user, issue); } finally { setRemoteUserInJira(oldUser); } }
protected void doValidation() { try { issueCreationHelperBean.validateProject(getIssueObject(), this, ActionContext.getParameters(), this, this); if (!invalidInput()) { getIssueObject().setProjectId(getPid()); } issueCreationHelperBean.validateIssueType(getIssueObject(), this, ActionContext.getParameters(), this, this); if (!invalidInput()) { getIssueObject().setIssueTypeId(getIssuetype()); } } catch (Exception e) { log.error(e, e); addErrorMessage("An exception occurred: " + e + "."); } }
cloneIssue.setProjectId(getTargetPid());
Issue createIssueForExternalIssue(final ExternalIssue externalIssue) { final MutableIssue issue = issueFactory.getIssue(); issue.setProjectId(new Long(externalIssue.getProject())); issue.setIssueTypeId(externalIssue.getIssueType()); issue.setReporterId(externalIssue.getReporter()); issue.setAssigneeId(externalIssue.getAssignee()); issue.setSummary(externalIssue.getSummary()); issue.setDescription(externalIssue.getDescription()); issue.setEnvironment(externalIssue.getEnvironment()); issue.setPriorityId(externalIssue.getPriority()); issue.setResolutionId(externalIssue.getResolution()); issue.setCreated(toTimeStamp(externalIssue.getCreated())); issue.setUpdated(toTimeStamp(externalIssue.getUpdated())); issue.setDueDate(toTimeStamp(externalIssue.getDuedate())); //NOTE: This HAS to come after the setResolutionId() call, otherwise that will override this date. issue.setResolutionDate(toTimeStamp(externalIssue.getResolutionDate())); issue.setVotes(externalIssue.getVotes()); issue.setOriginalEstimate(externalIssue.getOriginalEstimate()); issue.setTimeSpent(externalIssue.getTimeSpent()); issue.setEstimate(externalIssue.getEstimate()); if (externalIssue.getSecurityLevel() != null) { issue.setSecurityLevelId(new Long(externalIssue.getSecurityLevel())); } return issue; }
getIssueObject().setProjectId(getPid()); getIssueObject().setIssueTypeId(getIssuetype());