@Override public String apply(Issue issue) { return issue.getKey(); } });
public void writeIssue(final Issue issue, final AbstractIssueView issueView, final Writer writer) throws IOException { if (log.isDebugEnabled()) { log.debug("About to write XML view for issue [" + issue.getKey() + "]."); } writer.write(issueView.getBody(issue, searchRequestParams)); } };
private boolean isCurrentDeletedIssue(final String returnUrl) { final String key = getIssueObject().getKey(); return returnUrl.endsWith("browse/" + key) || returnUrl.contains("browse/" + key + "?"); }
/** * Supply a comma separated list of issue keys to parent issue selector. Passed issues are excluded from selection * since they are selected for bulk move. * * @param bulkEditBean Should be rootBulkEditBean because we need ass currently processing issues * @return coma separated list of issue keys */ public String getIssueKeys(BulkEditBean bulkEditBean) { return StringUtils.join(bulkEditBean.getSelectedIssues().stream().map(issue -> issue.getKey()).collect(Collectors.toList()), ','); }
private void dropField(final String documentFieldId, final FieldIndexer indexer, final Throwable e) { final String description = (documentFieldId != null) ? documentFieldId : indexer.getClass().getName(); LOG.warn("Error indexing issue " + issue.getKey() + ": Dropping '" + description + '\'', e); if (droppedFields == null) { droppedFields = newTreeSet(); } droppedFields.add(description); }
public String getParentIssueKey() { final Issue parentIssue = getParentIssue(); if (parentIssue != null) { return parentIssue.getKey(); } return null; }
public Collection<String> getPreviousIssueKeys(final Long issueId) { final Set<String> issueKeys = issueManager.getAllIssueKeys(issueId); final Issue issue = issueManager.getIssueObject(issueId); return ImmutableSet.copyOf(filter(issueKeys, not(equalTo(issue.getKey())))); }
@Override public Map<String, String> getMetadata(Issue issue, SearchRequest searchRequest) { Map<String, String> metadata = new HashMap<String, String>(); metadata.put("can-edit-watchers", canEditWatchers(issue)); metadata.put("can-search-users", canSearchUsers()); metadata.put("default-avatar-url", getDefaultAvatarURL()); metadata.put("issue-key", issue.getKey()); return metadata; }
@Nullable public T getValueFromIssue(CustomField field, Issue issue) { return getValueFromIssue(field, issue.getId(), issue.getKey()); }
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()); } }
public String getParentKey() { Issue parent = (getIssueObject().getParentObject()); if (parent != null) { return parent.getKey(); } return null; } }
private Issue createIssueWithIssueManager(final ApplicationUser reporter, final Issue issue) throws CreateException { final Issue issueObject = issueManager.createIssueObject(reporter, issue); monitor.info("Issue " + issueObject.getKey() + " created"); return issueObject; }
public String getNextUrl() { if (FROM_ISSUE.equals(getFrom())) { return "/browse/" + getIssueObject().getKey(); } else { return "ManageAttachments.jspa?id=" + getIssueId(); } }
public String getLinkToPrevious(final Issue issue, final JiraResourcedModuleDescriptor<?> descriptor) { final Map<String, Object> params = new HashMap<String, Object>(); final String baseUrl = new DefaultVelocityRequestContextFactory(applicationProperties).getJiraVelocityRequestContext().getBaseUrl(); params.put("i18n", authenticationContext.getI18nHelper()); params.put("link", baseUrl + "/browse/" + issue.getKey()); return descriptor.getHtml(PREVIOUS_VIEW_TEMPLATE_NAME, params); } }
private void hasLinkIssuePermission(final ApplicationUser user, final Issue issue, final ErrorCollection errors, final I18nHelper i18n) { if (!permissionManager.hasPermission(Permissions.LINK_ISSUE, issue, user)) { errors.addErrorMessage(i18n.getText("remotelink.service.no.link.issue.permission", issue.getKey()), Reason.FORBIDDEN); } }
@Override public ChangeItemBean createAttachment(File file, String filename, String contentType, ApplicationUser author, Issue issue) throws AttachmentException { validateAttachmentLimitSize(file, filename); final ChangeItemBean changeItemBean = attachmentManager.createAttachment(file, filename, contentType, author, issue); if (changeItemBean != null) { monitor.info("Added attachment to issue '" + issue.getKey() + "'"); } return changeItemBean; }
@Override public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequired, FieldLayoutItem fieldLayoutItem) { VoteManager voteManager = ComponentAccessor.getVoteManager(); if (voteManager.isVotingEnabled()) { return new FieldJsonRepresentation(new JsonData(VotesJsonBean.shortBean(issue.getKey(), issue.getVotes(), voteManager.hasVoted(authenticationContext.getUser(), issue), jiraBaseUrls))); } return null; } }
private AttachmentKey createAttachmentKey(final String filename, final Issue issue) { final Long attachmentId = attachmentIdSequencer.getNextId(); return AttachmentKey.builder() .withAttachmentFilename(filename) .withIssueKey(issue.getKey()) .withAttachmentId(attachmentId) .withProjectKey(issue.getProjectObject().getOriginalKey()) .build(); }
@Override public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequired, FieldLayoutItem fieldLayoutItem) { WatcherManager watcherManager = ComponentAccessor.getWatcherManager(); if (watcherManager.isWatchingEnabled()) { return new FieldJsonRepresentation(new JsonData(WatchersJsonBean.shortBean(issue.getKey(), issue.getWatches(), watcherManager.isWatching(authenticationContext.getUser(), issue), jiraBaseUrls))); } return null; }
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()); }