@Override protected String doExecute() throws Exception { final MutableIssue issue = issueManager.getIssueByKeyIgnoreCase(issueKey); if (issue == null) { return ERROR; } return SUCCESS; }
private void fetchIssueByKey() { if (!isNullOrEmpty(issueKey)) { issue = issueManager.getIssueByKeyIgnoreCase(issueKey); } } }
private Issue getIssue(final String issueKey, final ApplicationUser user, final boolean skipPermissionCheck) { if (StringUtils.isBlank(issueKey)) { return null; } final Issue issue = issueManager.getIssueByKeyIgnoreCase(issueKey); return checkPermission(user, issue, skipPermissionCheck); }
@Override @ExperimentalApi public MutableIssue getIssueByKeyIgnoreCase(final String key) throws DataAccessException {return delegate.getIssueByKeyIgnoreCase(key);}
private Either<Throwable, Issue> getIssueByKey(String issueKey) { try { final Issue issue = issueManager.getIssueByKeyIgnoreCase(issueKey); if (issue == null) { log.warn("Issue with key {} not found.", issueKey); return Either.<Throwable, Issue>left(new IllegalArgumentException("Issue not found.")); } if (!permissionManager.hasPermission(ProjectPermissions.BROWSE_PROJECTS, issue, authenticationContext.getUser())) { final String message = "User " + authenticationContext.getUser().getName() + " does not have permission to access issue " + issueKey; log.warn(message); return Either.<Throwable, Issue>left(new IllegalArgumentException(message)); } return Either.right(issue); } catch (RuntimeException ex) { log.warn("Failed to fetch issue with key=" + issueKey, ex); return Either.<Throwable, Issue>left(ex); } }
return Result.error("You are not logged in to JIRA.", FORBIDDEN.getStatusCode()); Issue issue = issueManager.getIssueByKeyIgnoreCase(issueKey); if (issue == null) { return Result.error("Issue " + issueKey + " not found.", NOT_FOUND.getStatusCode());
@Override protected String doExecute() throws Exception { final ApplicationUser loggedInUser = getLoggedInApplicationUser(); if (loggedInUser == null) { return ERROR; } final Option<HipChatUserId> hipChatUserId = hipChatUserFinder.findHipChatUser(new UserKey(loggedInUser.getKey())); if (hipChatUserId.isEmpty()) { return ERROR; } final MutableIssue issue = issueManager.getIssueByKeyIgnoreCase(issueKey); if (issue == null) { return ERROR; } if (!permissionManager.hasPermission(Permissions.EDIT_ISSUE, issue, loggedInUser)) { return ERROR; } dedicatedRoom = dedicatedRoomManager.getDedicatedRoom(issue); if (dedicatedRoom.isEmpty()) { return ERROR; } return SUCCESS; }
Issue issue = issueManager.getIssueByKeyIgnoreCase(issueKey); if (issue == null) { return Result.error("Issue " + issueKey + " not found.", NOT_FOUND.getStatusCode());
public Response panelData(@PathParam ("issueId") String issueId) { final ApplicationUser applicationUser = jiraUserManager.getUserByKey(userManager.getRemoteUser().getUserKey().getStringValue()); final Issue issue = issueManager.getIssueByKeyIgnoreCase(issueId);