public UpdateIssueRequest build() { return new UpdateIssueRequest(this); } }
protected void doUpdate(ApplicationUser user, MutableIssue issue, GenericValue originalIssueGV, DefaultIssueChangeHolder issueChangeHolder, UpdateIssueRequest updateRequest) { final EventDispatchOption dispatchOption = updateRequest.getEventDispatchOption(); IssueUpdateBean issueUpdateBean = new IssueUpdateBean(issue.getGenericValue(), originalIssueGV, dispatchOption.getEventTypeId(), user, updateRequest.isSendMail(), true); issueUpdateBean.setComment(issueChangeHolder.getComment()); issueUpdateBean.setChangeItems(issueChangeHolder.getChangeItems()); issueUpdateBean.setDispatchEvent(dispatchOption.isEventBeingSent()); issueUpdateBean.setHistoryMetadata(updateRequest.getHistoryMetadata()); issueUpdateBean.setParams(MapBuilder.newBuilder("eventsource", IssueEventSource.ACTION).toMutableMap()); issueUpdater.doUpdate(issueUpdateBean, false); }
@Override public Issue updateIssue(ApplicationUser user, MutableIssue issue, EventDispatchOption eventDispatchOption, boolean sendMail) { return updateIssue( user, issue, UpdateIssueRequest.builder().eventDispatchOption(eventDispatchOption).sendMail(sendMail).build()); }
issue, UpdateIssueRequest.builder() .eventDispatchOption(eventDispatchOption) .sendMail(sendMail)
/** * @return true if there were any issues affected */ private boolean swapOrRemoveVersionsFromIssues(final ApplicationUser user, final Version version, final Option<Version> affectsSwapVersion, final Option<Version> fixSwapVersion) { final Set<Long> issuesIds = getAllAssociatedIssueIds(version); // swap the versions on the affected issues for (final Long issueId : issuesIds) { final MutableIssue newIssue = issueManager.getIssueObject(issueId); newIssue.setAffectedVersions(getNewVersions(version, newIssue.getAffectedVersions(), affectsSwapVersion)); newIssue.setFixVersions(getNewVersions(version, newIssue.getFixVersions(), fixSwapVersion)); final Issue updated = issueManager.updateIssue(user, newIssue, UpdateIssueRequest.builder(). eventDispatchOption(EventDispatchOption.ISSUE_UPDATED). sendMail(false).build()); try { // reindex all the affected issues issueIndexManager.reIndex(updated); } catch (final IndexException e) { log.warn("Could not reindex issue with id '" + issueId + "' after swapping versions", e); } } return issuesIds.size() > 0; }