public IssueUpdateBean(Issue changedIssue, Issue originalIssue, Long eventTypeId, ApplicationUser user, boolean sendMail, boolean subtasksUpdated) { this(changedIssue.getGenericValue(), originalIssue.getGenericValue(), eventTypeId, user, sendMail, subtasksUpdated); }
public Object transform(final Object object) { return ((Issue) object).getGenericValue(); } };
GetterResult(@Nullable Issue object) { this.object = object; this.genericValue = object != null ? object.getGenericValue() : null; } }
@Override public int removeIssueLinksNoChangeItems(Issue issue) { return removeIssueLinksInternal(issue.getGenericValue(), null, false); }
@Override public Collection<Version> getAffectedVersionsFor(Issue issue) { return getVersionsByIssue(issue.getGenericValue(), IssueRelationConstants.VERSION); }
@Override public List<ApplicationUser> getWatchersFor(Issue issue) { return userAssociationStore.getUsersFromSink("WatchIssue", issue.getGenericValue()); }
@Override public boolean removeVote(ApplicationUser user, Issue issue) { return updateVote(false, user, issue.getGenericValue()); }
@Override public boolean addVote(ApplicationUser user, Issue issue) { return updateVote(true, user, issue.getGenericValue()); }
@Override public Collection<Version> getFixVersionsFor(Issue issue) { return getVersionsByIssue(issue.getGenericValue(), IssueRelationConstants.FIX_VERSION); }
@Override public Iterable<String> getVoterNames(final @Nonnull Issue issue) { return voteManager.getVoterUsernames(issue.getGenericValue()); }
public ChangeItemBean createAttachment(final MultiPartRequestWrapper requestWrapper, final ApplicationUser remoteUser, final Issue issue, final String fileParamName, final Map<String, Object> attachmentProperties) throws AttachmentException { return createAttachment(requestWrapper, remoteUser, issue.getGenericValue(), fileParamName, attachmentProperties); }
/** * Retrieves the collection of sub-tasks associated with the current issue. * @return The collection of sub-tasks associated with the current issue. */ public Collection<GenericValue> getSubTasks() { final Collection<Issue> issues = getSubTaskManager().getSubTaskObjects(getIssueObject()); final Stream<GenericValue> x = issues.stream().map(issue -> issue.getGenericValue()); return x.collect(Collectors.toList()); }
public void addIndex(Document doc, Issue issue) { // Add actual vs estimated work ratio to index for range query - only add work ratio if a time estimate for issue exists if (issue.getOriginalEstimate() != null) { doc.add(new Field(getDocumentFieldId(), WorkRatio.getPaddedWorkRatio(issue.getGenericValue()), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); } } }
public Collection getSubTasks(GenericValue issue) { List<GenericValue> subTaskIssues = new LinkedList<GenericValue>(); for (IssueLink issueLink : subTaskManager.getSubTaskIssueLinks(issue.getLong("id"))) { subTaskIssues.add(issueLink.getDestinationObject().getGenericValue()); } return subTaskIssues; } }
public MutableIssue cloneIssueNoParent(final Issue issue) { final IssueImpl clonedIssue = new IssueImpl((GenericValue) issue.getGenericValue().clone(), issueManager, projectManager, versionManager, issueSecurityLevelManager, constantsManager, subTaskManager, attachmentManager, labelManager, projectComponentManager, userManager, jiraAuthenticationContext); clonedIssue.hasNoParentId = true; return clonedIssue; } }
@Nonnull public Map<String, Object> getVelocityParameters(final Issue issue, final CustomField field, final FieldLayoutItem fieldLayoutItem) { return MapBuilder.<String, Object> newBuilder().add("issueGv", issue != null ? issue.getGenericValue() : null).toMutableMap(); }
private void removeChildActions(final Issue issue) throws GenericEntityException { for (Comment comment : commentManager.getComments(issue)) { commentManager.delete(comment); } // remove actions issue.getGenericValue().removeRelated("ChildAction"); }
IssueUpdateBean constructIssueUpdateBeanForAttachmentDelete(Attachment attachment, Issue issue, ApplicationUser user) { //generate change history for issue to show that attachment has been deleted ChangeItemBean changeItem = new ChangeItemBean(ChangeItemBean.STATIC_FIELD, "Attachment", attachment.getId().toString(), attachment.getFilename(), null, null); List<ChangeItemBean> changeItemBeans = EasyList.build(changeItem); //configure issue update event IssueUpdateBean issueUpdateBean = new IssueUpdateBean(issue.getGenericValue(), issue.getGenericValue(), EventType.ISSUE_UPDATED_ID, user); issueUpdateBean.setChangeItems(changeItemBeans); issueUpdateBean.setDispatchEvent(true); issueUpdateBean.setParams(MapBuilder.build("eventsource", IssueEventSource.ACTION)); return issueUpdateBean; }
private void createChangeItem(final ChangeItemBean changeItemBean, final Issue issue, final ApplicationUser remoteUser) { final GenericValue issueGv = issue.getGenericValue(); // Note the event will not be dispatched. The issue is updated however so we pass ISSUE_UPDATED constant final IssueUpdateBean issueUpdateBean = new IssueUpdateBean(issueGv, issueGv, EventType.ISSUE_UPDATED_ID, remoteUser); issueUpdateBean.setDispatchEvent(false); issueUpdateBean.setChangeItems(EasyList.build(changeItemBean)); issueUpdater.doUpdate(issueUpdateBean, true); }
private List<IssueSecurityLevel> getSecurityLevelsForLoggedInUser(Issue issue) { if (issue.getGenericValue() == null) { return issueSecurityLevelManager.getUsersSecurityLevels(issue.getProjectObject(), getAuthenticationContext().getUser()); } else { return issueSecurityLevelManager.getUsersSecurityLevels(issue, getAuthenticationContext().getUser()); } }