public boolean evaluate(final Issue input) { return input.getId().equals(sr.selectedIssueId); } });
@Override public void resetSequences(Issue issue) { resetSequences(issue.getId()); }
@Override public String getUniqueContextKey(Map<String, Object> context) { final Issue issue = (Issue) context.get("issue"); final ApplicationUser user = (ApplicationUser) context.get("user"); return issue.getId() + "/" + (user == null ? "" : user.getName()); }
@Override public Collection<String> getWatcherUserKeys(@Nonnull Issue issue) { return getWatchersCache().getUnchecked(issue.getId()); }
@Override @Nullable public Long getParentIssueId(Issue issue) { return getParentIssueId(issue.getId()); }
public void addIssueToHistory(@Nonnull final ApplicationUser user, @Nonnull final Issue issue) { notNull("issue", issue); userHistoryManager.addItemToHistory(UserHistoryItem.ISSUE, user, issue.getId().toString()); }
@Nullable public T getValueFromIssue(CustomField field, Issue issue) { return getValueFromIssue(field, issue.getId(), issue.getKey()); }
@Override public boolean isWatching(@Nullable ApplicationUser user, @Nonnull Issue issue) { if (user == null) { return false; } // For performance: if there are no watches for the issue then this dude isn't watching it. Long watches = issue.getWatches(); return !(watches == null || watches == 0) && getWatchersCache().getUnchecked(issue.getId()).contains(user.getKey()); }
public void removeValue(CustomField field, Issue issue, Option option) { if (option != null) { customFieldValuePersister.removeValue(field, issue.getId(), PersistenceFieldType.TYPE_LIMITED_TEXT, option.getOptionId().toString()); } }
/** * At this point we know that the value doesn't exist, and that <value> * is not null. */ public void createValue(CustomField field, Issue issue, @Nonnull T value) { customFieldValuePersister.createValues(field, issue.getId(), getDatabaseType(), Lists.newArrayList(getDbValueFromObject(value))); }
@Override public void removeAssociation(String associationType, ApplicationUser user, Issue sink) { removeAssociation(associationType, user.getKey(), Entity.Name.ISSUE, sink.getId()); }
@Override public void createAssociation(String associationType, ApplicationUser user, Issue sink) { createAssociation(associationType, user.getKey(), Entity.Name.ISSUE, sink.getId()); }
/** @see CustomFieldType#getValueFromIssue(com.atlassian.jira.issue.fields.CustomField,com.atlassian.jira.issue.Issue) */ @Override public Collection<S> getValueFromIssue(final CustomField field, final Issue issue) { final List<Object> textValues = customFieldValuePersister.getValues(field, issue.getId(), getDatabaseType()); return ((textValues == null) || textValues.isEmpty()) ? null : convertDbObjectToTypes(textValues); }
public int getNumberOfSubTasks() { if (numberOfSubTasks == null) { numberOfSubTasks = getSubTaskManager().getSubTaskIssueLinks(getIssueObject().getId()).size(); } return numberOfSubTasks; } }
public Collection<String> getPreviousIssueKeys(final String issueKey) { notNull("issueKey", issueKey); Issue theIssue = issueManager.getIssueObject(issueKey); if (theIssue == null) { return Collections.emptySet(); } return getPreviousIssueKeys(theIssue.getId()); }
public String getUserProfileHtml() { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("avatarURL", getAvatarURL(issue.getCreator())); if (issue.getCreatorId() == null) { parameters.put("username", i18nHelper.getText("creator.types.nocreator")); } return userFormatManager.formatUserkey(issue.getCreatorId(), "profileLinkActionHeader", "issuecreator_"+issue.getId(), parameters); }
public void createValue(final Issue issue, final Object value) { String labelString = (String) value; final Set<String> labels = getLabelSet(labelString); //validation should have already happened by now. No need to check the result labelManager.setLabels(authenticationContext.getUser(), issue.getId(), labels, false, false); }
@Override public Attachment apply(final Object ignore) { final Boolean zip = null; final Boolean thumbnailable = null; final Map<String, Object> attachmentProperties = null; return insertAttachment( issue.getId(), ApplicationUsers.getKeyFor(author), params.getContentType(), filename, fileSize, zip, thumbnailable, attachmentProperties, createdTime, attachmentKey.getAttachmentId() ); } });
protected void removeSubTasks(ApplicationUser user, Issue parentIssue, EventDispatchOption eventDispatchOption, boolean sendMail) throws RemoveException { for (IssueLink subTaskIssueLink : subTaskManager.getSubTaskIssueLinks(parentIssue.getId())) { Issue subTaskIssue = subTaskIssueLink.getDestinationObject(); log.debug("Deleting sub-task issue with key: " + subTaskIssue.getKey()); deleteIssue(user, subTaskIssue, eventDispatchOption, sendMail); log.debug("Deleted sub-task issue with key: " + subTaskIssue.getKey()); } }
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()); }