@Override public Issue updateIssue(final ApplicationUser user, final MutableIssue issue, final EventDispatchOption eventDispatchOption, final boolean sendMail) {return delegate.updateIssue(user, issue, eventDispatchOption, sendMail);}
@Override public Issue updateIssue(final ApplicationUser user, final MutableIssue issue, final UpdateIssueRequest updateIssueRequest) {return delegate.updateIssue(user, issue, updateIssueRequest);}
@Override public void moveUnreleasedToNewVersion(@Nullable ApplicationUser directoryUser, @Nonnull Version currentVersion, @Nonnull Version newVersion) { final List<Issue> issues = getUnresolvedIssues(directoryUser, currentVersion); if (!issues.isEmpty()) { for (final Issue issue : issues) { // Need to look this up from the DB since we have DocumentIssues from the search. final MutableIssue mutableIssue = issueManager.getIssueObject(issue.getId()); final Collection<Version> versions = mutableIssue.getFixVersions(); versions.remove(currentVersion); versions.add(newVersion); mutableIssue.setFixVersions(versions); issueManager.updateIssue(directoryUser, mutableIssue, EventDispatchOption.ISSUE_UPDATED, true); } } }
private void swapComponentForAffectedIssues(final JiraServiceContext context, final ProjectComponent component, final ProjectComponent swapComponent) { // Get all issues that reference the component we are going to delete Collection<Long> affectedIssues = projectComponentManager.getIssueIdsWithComponent(component); for (final Long issueId : affectedIssues) { MutableIssue issue = issueManager.getIssueObject(issueId); Collection<ProjectComponent> newComponents = getNewComponents(issue, component, swapComponent); issue.setComponent(newComponents); // Use the backend issue update action to update the issue issueManager.updateIssue(context.getLoggedInUser(), issue, EventDispatchOption.ISSUE_UPDATED, false); } // publish project component merged event if necessary if (!affectedIssues.isEmpty() && swapComponent != null) { eventPublisher.publish(new ProjectComponentMergedEvent(swapComponent, component)); } }
try updatedIssue = (MutableIssue) issueManager.updateIssue( user, issue, UpdateIssueRequest.builder()
/** * @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; }
issueManager.updateIssue(applicationUser, issue, EventDispatchOption.ISSUE_UPDATED, sendMail);
@Override public IssueResult assign(final ApplicationUser user, AssignValidationResult assignResult) { final MutableIssue issue = assignResult.getIssue(); // update the assignee system field OrderableField field = (OrderableField) fieldManager.getField(IssueFieldConstants.ASSIGNEE); FieldLayoutItem fieldLayoutItem = fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(field); field.updateIssue(fieldLayoutItem, issue, EasyMap.build(field.getId(), assignResult.getAssigneeId())); final SimpleErrorCollection errorCollection = new SimpleErrorCollection(); try { issueManager.updateIssue(user, issue, EventDispatchOption.ISSUE_ASSIGNED, true); } catch (RuntimeException e) { log.error("There was an exception while trying to update the issue '" + issue.getKey() + "'.", e); errorCollection.addErrorMessage(getI18n(user).getText("admin.errors.issues.exception.occured", issue.getKey())); } return new IssueResult(issue, errorCollection); }
@RequiresXsrfCheck protected String doExecute() throws Exception { MutableIssue issue = getMutableIssue(); // update the assignee system field OrderableField field = (OrderableField) fieldManager.getField(IssueFieldConstants.ASSIGNEE); FieldLayoutItem fieldLayoutItem = fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(field); field.updateIssue(fieldLayoutItem, issue, getFieldValuesHolder()); // This hack is here until the comment field becomes placeable on screens by the users OrderableField commentField = (OrderableField) fieldManager.getField(IssueFieldConstants.COMMENT); FieldLayoutItem fieldLayoutItem2 = fieldLayoutManager.getFieldLayout(issue.getProjectObject(), issue.getIssueTypeId()).getFieldLayoutItem(commentField); commentField.updateIssue(fieldLayoutItem2, issue, getFieldValuesHolder()); issueManager.updateIssue(getLoggedInUser(), issue, ISSUE_ASSIGNED, true); if (isInlineDialogMode()) { return returnComplete(); } return getRedirect("/browse/" + issue.getKey()); }