public ApplicationUser getReporter() { return issue.getReporter(); }
@Override protected ChangeHistoryItem createInitialChangeItem(Issue issue) { final ApplicationUser reporter = issue.getReporter(); final String reporterName = reporter == null ? "" : issue.getReporter().getDisplayName(); final String reporterValue = issue.getReporterId() == null ? EMPTY_VALUE : issue.getReporterId(); return changeItemBuilder(issue).to(reporterName, reporterValue).build(); } }
this.reporter = issue.getReporter() != null ? issue.getReporter().getName() : null;
public ApplicationUser getReporter() { return issue.getReporter(); }
public boolean hasValue(Issue issue) { return (issue.getReporter() != null); }
@Override public Set<ApplicationUser> getUsers(final PermissionContext ctx, final String ignored) { final Issue issue = ctx.getIssue(); if (issue != null && issue.getReporter() != null && getPermissionManager().hasPermission(CREATE_ISSUE, issue.getReporter())) { return newHashSet(issue.getReporter()); } return newHashSet(); }
public Set<ApplicationUser> getUsers(PermissionContext ctx, String ignored) { if (ctx.getIssue() != null && ctx.getIssue().getReporter() != null) { return Collections.singleton(ctx.getIssue().getReporter()); } return Collections.emptySet(); } }
public String getViewHtml(FieldLayoutItem fieldLayoutItem, Action action, Issue issue, Map displayParameters) { Map velocityParams = getVelocityParams(fieldLayoutItem, action, issue, displayParameters); velocityParams.put("reporter", issue.getReporter()); return getViewHtml(velocityParams); }
@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<String> getSuggestedAssigneeKeys(Issue issue, final ApplicationUser loggedInUser) { Set<String> suggestedAssignees = new HashSet<String>(); if (loggedInUser != null) { // HACK - temp only to make old tests pass - only add the logged in user in Frother mode if (useFrotherControl()) { // We need the key, not the username suggestedAssignees.add(loggedInUser.getKey()); } } suggestedAssignees.addAll(getRecentAssigneeKeysForIssue(issue)); suggestedAssignees.addAll(getRecentAssigneeKeysForUser(loggedInUser)); // Reporter may be null for new issues. ApplicationUser reporter = issue == null ? null : issue.getReporter(); if (reporter != null) { // We need the key, not the username suggestedAssignees.add(reporter.getKey()); } return suggestedAssignees; }
private Iterable<NotificationRecipient> getRecipientsFromNotification(ApplicationUser remoteUser, Issue issue, NotificationBuilder notification) { final ImmutableList.Builder<NotificationRecipient> recipients = ImmutableList.<NotificationRecipient>builder() .addAll(getEmailRecipients(notification)) .addAll(getUserRecipients(notification)) .addAll(getGroupRecipients(notification)); if (notification.isToReporter()) { recipients.add(new NotificationRecipient(issue.getReporter())); } if (notification.isToAssignee()) { recipients.add(new NotificationRecipient(issue.getAssignee())); } if (notification.isToWatchers()) { recipients.addAll(getWatchersRecipients(remoteUser, issue)); } if (notification.isToVoters()) { recipients.addAll(getVotersRecipients(remoteUser, issue)); } return restrict(removeRemoteUserIfNecessary(recipients.build(), remoteUser), issue, (NotificationBuilderImpl) notification); }
@Override public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequired, FieldLayoutItem fieldLayoutItem) { return new FieldJsonRepresentation(new JsonData(userBeanFactory.createBean(issue.getReporter(), authenticationContext.getUser()))); }
public boolean passesCondition(Map transientVars, Map args, PropertySet ps) { ApplicationUser caller = getCallerUser(transientVars, args); ApplicationUser reporter = null; try { reporter = getIssue(transientVars).getReporter(); } catch (DataAccessException e) { log.warn("Could not retrieve reporter with id '" + getIssue(transientVars).getAssigneeId() + "' of issue '" + getIssue(transientVars).getKey() + "'"); } if (caller != null && reporter != null && caller.equals(reporter)) return true; else return false; } }