public Long getProjectId() { return issue.getProjectId(); }
public Long getProjectId() { return issue.getProjectId(); }
private boolean projectMoved(final Issue originalIssue, final Issue targetIssue) { // JRA-20184: Should only check the ID, the other fields can change. // Don't do any null checks - a null Project or ID is an unrecoverable error. final Long originalProjectId = originalIssue.getProjectId(); final Long targetProjectId = targetIssue.getProjectId(); return !originalProjectId.equals(targetProjectId); }
public void populateFromIssue(Map<String, Object> fieldValuesHolder, Issue issue) { fieldValuesHolder.put(getId(), issue.getProjectId()); }
/** * Retrieve the list of project id's from issue or field config, in the following order: * <ol> * <li>If {@code issue} is not null and issue.getProjectId() is not null, return a single list with issue.getProjectId()</li> * <li>If {@code config} is not null, use it to retrieve the list of project id's associated with the current scheme</li> * <li>Otherwise, return null</li> * </ol> * * @since v6.2 */ public static Collection<Long> getProjectIdsFromIssueOrFieldConfig( final Issue issue, final FieldConfig config, final FieldConfigSchemeManager fieldConfigSchemeManager, final ProjectManager projectManager) { return getProjectIdsFromProjectOrFieldConfig(issue == null ? null : issue.getProjectId(), config, fieldConfigSchemeManager, projectManager); }
@Override public Object getConfigurationObject(Issue issue, FieldConfig config) { if (issue != null && issue.getProjectId() != null) { return new GenericImmutableOptions(versionManager.getVersions(issue.getProjectId()), config); } else { return new GenericImmutableOptions(Collections.emptyList(), config); } }
public Object getConfigurationObject(Issue issue, FieldConfig config) { if (issue != null && issue.getProjectId() != null) { return new GenericImmutableOptions(versionManager.getVersions(issue.getProjectId()), config); } else { return new GenericImmutableOptions(Collections.EMPTY_LIST, config); } }
public Long getPid() { final Long parentIssueId = getParentIssueId(); final Issue issue = issueManager.getIssueObject(parentIssueId); if (issue != null) { return issue.getProjectId(); } else { log.error("Issue with id '" + parentIssueId + "' does not exist or could not be retrieved."); return null; } }
/** Get all {@link CustomField}s in scope for this issue's project/type. */ public List<CustomField> getCustomFieldObjects(Issue issue) { return getCustomFieldObjects(issue.getProjectId(), issue.getIssueTypeId()); }
/** * Convenience method that returns a workflow retrieved based on issue's * project and issue type. * <br/> * If you need to retrieve a workflow in a more flexible way use * {@link #getWorkflowForProjectAndIssueType(Long,String)} method. * * @param issue issue to read the project and issue type from * @return workflow based on issue's project and issue type */ private JiraWorkflow getWorkflowForIssue(Issue issue) { return getWorkflowForProjectAndIssueType(issue.getProjectId(), issue.getIssueTypeId()); }
public DedicatedRoomLinkedEvent(Issue issue, long roomId, boolean guestAccessEnabled) { super(issue.getProjectId(), issue.getId(), roomId); this.issueKey = issue.getKey(); this.guestAccessEnabled = guestAccessEnabled; }
public DedicatedRoomUnlinkedEvent(Issue issue, long roomId) { super(issue.getProjectId(), issue.getId(), roomId); this.issueKey = issue.getKey(); }
public boolean isStatusChangeRequired(JiraServiceContext context, Issue issue, IssueType issueType) { Status status = issue.getStatusObject(); final Long projectId = issue.getProjectId(); final String subTaskId = issueType.getId(); return !isStatusInWorkflowForProjectAndIssueType(status, projectId, subTaskId); }
public InviteContributorsPerformedEvent(long roomId, Issue issue, final int numberOfInvitees) { super(issue.getProjectId(), issue.getId(), roomId); this.issueId = issue.getId(); this.issueKey = issue.getKey(); this.numberOfInvitees = numberOfInvitees; }
public InviteContributorsStartedEvent(long roomId, Issue issue) { super(issue.getProjectId(), issue.getId(), roomId); this.issueId = issue.getId(); this.issueKey = issue.getKey(); }
public List<CustomField> getCustomFields(Issue issue) { return getCustomFieldManager().getCustomFieldObjects(issue.getProjectId(), issue.getIssueTypeId()); }
public void addIndex(Document doc, Issue issue) { if (issue.getProjectObject() != null) { indexKeyword(doc, getDocumentFieldId(), String.valueOf(issue.getProjectId()), issue); // For sorting final String key = issue.getProjectObject().getKey(); if (key != null) { indexKeyword(doc, DocumentConstants.PROJECT_KEY, key.toLowerCase(Locale.ENGLISH), issue); } } } }
@Override public void recordMovedIssueKey(Issue oldIssue) { // Record the historical issue key under all historical keys for the project, for easy lookup later final Set<String> projectKeys = projectKeyStore.getProjectKeys(oldIssue.getProjectId()); for (final String projectKey : projectKeys) { String oldIssueKey = IssueKey.format(projectKey, oldIssue.getNumber()); movedIssueKeyStore.recordMovedIssueKey(oldIssueKey, oldIssue.getId()); } }
public void validateTargetStatus(JiraServiceContext context, Status status, final String fieldName, Issue issue, IssueType issueType) { final Long projectId = issue.getProjectId(); final String subTaskId = issueType.getId(); final ErrorCollection errorCollection = context.getErrorCollection(); if (!isStatusChangeRequired(context, issue, issueType) && !status.getId().equals(issue.getStatusObject().getId())) { errorCollection.addErrorMessage(getText("convert.issue.to.subtask.errormessage.nochangeneeded")); } if (!isStatusInWorkflowForProjectAndIssueType(status, projectId, subTaskId)) { errorCollection.addError(fieldName, getText("convert.issue.to.subtask.error.invalidstatusfortargetworkflow", status.getNameTranslation())); } }
protected ChangeHistoryItem.Builder changeItemBuilder(Issue issue) { return new ChangeHistoryItem.Builder() .withId(MINUS_1) .inChangeGroup(MINUS_1) .forIssue(issue.getId(), issue.getKey()) .inProject(issue.getProjectId()) .field(getField()) .on(issue.getCreated()) .byUser(issue.getReporterId() == null ? DocumentConstants.ISSUE_NO_AUTHOR : issue.getReporterId()); }