@Override protected Issue transform(final Long o) { return issueManager.getIssueObject(o); } }, sink);
public Collection<String> getPreviousIssueKeys(final Long issueId) { final Set<String> issueKeys = issueManager.getAllIssueKeys(issueId); final Issue issue = issueManager.getIssueObject(issueId); return ImmutableSet.copyOf(filter(issueKeys, not(equalTo(issue.getKey())))); }
@Override public Issue createIssueObject(final ApplicationUser remoteUser, final Map<String, Object> fields) throws CreateException {return delegate.createIssueObject(remoteUser, fields);}
DeletedIssueEventData(IssueManager issueManager, CustomFieldManager customFieldManager, boolean sendMail, Long issueId) { if (issueId == null) { issue = null; customFieldValues = null; watchers = null; } else { issue = issueManager.getIssueObject(issueId); // don't remove, this inits thread-local cache! issue.getParentId(); customFieldValues = collectCustomFieldValues(customFieldManager); watchers = issueManager.getWatchers(issue); } this.sendMail = sendMail; }
@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); } } }
@Override public Set<String> getAllIssueKeys(final Long issueId) {return delegate.getAllIssueKeys(issueId);}
@Override public List<GenericValue> getEntitiesByIssueObject(final String relationName, final Issue issue) throws GenericEntityException {return delegate.getEntitiesByIssueObject(relationName, issue);}
@Override @ExperimentalApi public MutableIssue getIssueByCurrentKey(final String key) throws DataAccessException {return delegate.getIssueByCurrentKey(key);}
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)); } }
public CommitSearchResults findCommits(final Issue issue) { final List<Commit> commits = new ArrayList<Commit>(); final List<CredentialsRequest> credentialsRequests = new ArrayList<CredentialsRequest>(); final List<IntegrationProblem> problems = new ArrayList<IntegrationProblem>(); final List<ApplicationLink> serversWithTruncatedResults = new ArrayList<ApplicationLink>(); int serversQueried = 0; for (final String issueKey : issueManager.getAllIssueKeys(issue.getId())) { serversQueried += getCommits(commits, credentialsRequests, problems, serversWithTruncatedResults, issueKey); } return new CommitSearchResults( commits, credentialsRequests, problems, serversWithTruncatedResults, serversQueried); }
public boolean hasWorkStarted(Issue issue) { if (issue.getGenericValue() == null) { return false; } try { return !issueManager.getEntitiesByIssueObject(IssueRelationConstants.TYPE_WORKLOG, issue).isEmpty(); } catch (Exception e) { return true; } }
@Override public void execute(String roomId, Option<String> message) { String issueKey = message.get(); MutableIssue issue = manager.getIssueByCurrentKey(issueKey); JiraCommandEvent event = new JiraCommandEvent(COMMAND, TEMPLATE, ImmutableMap.<String, Object>of("issue", issue)); SendNotificationTask task = taskBuilder.newSendNotificationTask(event, roomId); taskExecutorService.submitTask(task); }
private Issue getIssueObject(Long issueId) { return issueManager.getIssueObject(issueId); } }
@SuppressWarnings("deprecation") public static Set<String> getAllIssueKeys(IssueManager issueManager, ChangeHistoryManager changeHistoryManager, Issue issue) { if (GET_ALL_ISSUE_KEYS_EXISTS) { return issueManager.getAllIssueKeys(issue.getId()); } else { Set<String> allIssueKeys = new HashSet<>(); if (issue != null) { // adding current issue key allIssueKeys.add(issue.getKey()); // Adding previous issue keys allIssueKeys.addAll(changeHistoryManager.getPreviousIssueKeys(issue.getId())); } return allIssueKeys; } }
public List<Comment> apply(final Issue issue) { final List<Comment> comments = new ArrayList<Comment>(); try { // get a List<GenericValue> of comments final List<GenericValue> allComments = issueManager.getEntitiesByIssueObject(IssueRelationConstants.COMMENTS, issue); for (final GenericValue element : allComments) { comments.add(new SimpleComment(element, issue)); } } catch (final GenericEntityException e) { throw new DataAccessException(e); } Collections.sort(comments, CommentComparator.COMPARATOR); return comments; } }
@Override public Issue createIssueObject(final String remoteUserName, final Map<String, Object> fields) throws CreateException {return delegate.createIssueObject(remoteUserName, fields);}
for (String issueKey : extractIssueKeys(message)) { logger.debug("issue key '" + issueKey + "'"); final MutableIssue issue = issueManager.getIssueByCurrentKey(issueKey); final Room room = roomMessage.getItem().getRoom();
private Issue getIssueByKey(String issueKey) { try { return issueManager.getIssueObject(issueKey); } catch (final DataAccessException dae) { // Not found return null; } }
public List<Comment> getComments(Issue issue) { List<Comment> comments = new ArrayList<Comment>(); try { // get a List<GenericValue> of comments List allComments = issueManager.getEntitiesByIssueObject(IssueRelationConstants.COMMENTS, issue); for (final Object allComment : allComments) { Comment comment = convertToComment((GenericValue) allComment, issue); comments.add(comment); } } catch (GenericEntityException e) { throw new DataAccessException(e); } Collections.sort(comments, CommentComparator.COMPARATOR); return comments; }
@Override public Issue createIssueObject(final ApplicationUser remoteUser, final Issue issue) throws CreateException {return delegate.createIssueObject(remoteUser, issue);}