@Override public String toString() { final Issue issue = event.getIssue(); final String issueString = new ToStringBuilder(issue).append("id", issue.getId()).append("summary", issue.getSummary()).append("key", issue.getKey()).append("created", issue.getCreated()).append("updated", issue.getUpdated()).append("assignee", issue.getAssignee()).append( "reporter", issue.getReporter()).toString(); return new ToStringBuilder(this).append("issue", issueString).append("remoteUser", event.getUser()).append("notificationType", notificationType).append("eventTypeId", event.getEventTypeId().longValue()).append("templateId", templateId.longValue()).toString(); }
private Set<Project> getIssueProjects(Collection<Issue> issues) { Set<Project> projects = new HashSet<Project>(); for (Issue issue : issues) { projects.add(issue.getProjectObject()); } return projects; }
private List<SearchMatch> transformResults(final Collection<Issue> issues) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); for (Issue issue : issues) { matches.add(new BasicSearchMatch(applicationProperties.getBaseUrl() + "/browse/" + issue.getKey(), "[" + issue.getKey() + "] " + issue.getSummary(), issue.getDescription(), new BasicResourceType(applicationProperties, issue.getIssueTypeObject().getId()))); } return matches; }
public AbstractIssueSkeleton(Issue issue) { this.type = issue.getIssueTypeObject(); this.key = issue.getKey(); this.summary = issue.getSummary(); this.priority = issue.getPriorityObject(); }
public String getParentKey() { Issue parent = (getIssueObject().getParentObject()); if (parent != null) { return parent.getKey(); } return null; } }
public TransitionMetaFieldBeanBuilder(final FieldScreenRendererFactory fieldScreenRendererFactory, final FieldLayoutManager fieldLayoutManager, ActionDescriptor action, final Issue issue, final ApplicationUser user, VersionBeanFactory versionBeanFactory, VelocityRequestContextFactory velocityRequestContextFactory, ContextUriInfo contextUriInfo, JiraBaseUrls baseUrls) { super(fieldLayoutManager, issue.getProjectObject(), issue, issue.getIssueTypeObject(), user, versionBeanFactory, velocityRequestContextFactory, contextUriInfo, baseUrls, null); this.action = action; fieldScreenRenderer = fieldScreenRendererFactory.getFieldScreenRenderer(user, issue, action); }
public IssueRefJsonBean createIssueRefJsonBean(final Issue issue) { return new IssueRefJsonBean() .id(String.valueOf(issue.getId())) .key(issue.getKey()) .self(URI.create(jiraBaseUrls.restApi2BaseUrl() + "issue/" + issue.getId())) .fields(new IssueRefJsonBean.Fields() .summary(issue.getSummary()) .status(StatusJsonBean.bean(issue.getStatusObject(), jiraBaseUrls)) .issueType(IssueTypeJsonBean.shortBean(issue.getIssueTypeObject(), jiraBaseUrls)) .priority(PriorityJsonBean.shortBean(issue.getPriorityObject(), jiraBaseUrls)) ); } }
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)); } };
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()); }
private void deindex(Issue issue) { try { indexManager.deIndex(issue); } catch (Exception issueDeIndexException) { log.error("Error deindexing issue: [" + issue.getKey() + "] " + issue.getSummary() + ":" + issueDeIndexException, issueDeIndexException); } }
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(); }
public Object transform(Object input) { return ((Issue) input).getId(); } };
private IssuePickerIssue getIssue(Issue issue, IssuePickerResults result) { DelimeterInserter delimeterInserter = new DelimeterInserter("<b>", "</b>"); // Lets assume that anything that has one of the following one char before it, is a new word. delimeterInserter.setConsideredWhitespace("-_/\\,.+=&^%$#*@!~`'\":;<>"); final String[] keysTerms = result.getKeyTerms().toArray(new String[result.getKeyTerms().size()]); final String[] summaryTerms = result.getSummaryTerms().toArray(new String[result.getSummaryTerms().size()]); final String issueKey = delimeterInserter.insert(TextUtils.htmlEncode(issue.getKey()), keysTerms); final String issueSummary = delimeterInserter.insert(TextUtils.htmlEncode(issue.getSummary()), summaryTerms); return new IssuePickerIssue(issue.getKey(), issueKey, getIconURI(option(issue.getIssueTypeObject())), issueSummary, issue.getSummary()); }
public String getHtml() { String title = issue.getKey() + ": " + issue.getSummary(); String description = issue.getDescription() != null ? issue.getDescription() : issue.getSummary(); String fisheyeUrl = instance.getUrl(); Map<String, Object> params = EasyMap.build("changesets", changesets, "fisheyeurl", fisheyeUrl, "title", title, "description", description, "crucibleProject", crucibleProject ); params.put("jfpTextutils", new JiraFisheyeEscapeTools()); return getDescriptorHtml("createissuereview", params); }
private boolean doIssuePermissionCheck(ProjectPermissionKey permissionKey, final Issue issue, final ApplicationUser user) { // JRA-14788: if generic value of issue object is null, need to defer permission check to project object. if (issue.getId() != null) { return doIssuePermissionCheck(permissionKey, issue, user, false); } else { return doProjectPermissionCheck(permissionKey, issue.getProjectObject(), user, true); } }
@Override public boolean hasIssuePermissions() { // For workflow-based permissions, we need the issue and a known type to look up a workflow return (issue != null && issue.getIssueTypeObject() != null); } }
@Override protected String getInitialValue(Issue issue, ErrorCollection errors) { return issue.getSummary(); }
@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; } }
public PermissionContext getPermissionContext(Issue issue) { return new PermissionContextImpl(issue, issue.getProjectObject(), issue.getStatusObject()); }