Interface ApprovalService


@PublicApi @ParametersAreNonnullByDefault @ReturnValuesAreNonnullByDefault public interface ApprovalService
  • Method Summary

    Modifier and Type
    Method
    Description
    answerApproval(com.atlassian.jira.user.ApplicationUser user, Approval approval, ApprovalDecisionType decision)
    Answer to an approval of a given approvalId The answer could be approve or decline Required permissions: - User is an approver of the approval - User can view the request that the approval belongs to
    answerApproval(com.atlassian.jira.user.ApplicationUser user, Approval approval, ApprovalDecisionType decision, ApprovalComment approvalComment)
    Answer to an approval of a given approvalId The answer could be approve or decline Required permissions: - User is an approver of the approval - User can view the request that the approval belongs to
    canAnswerApproval(com.atlassian.jira.user.ApplicationUser user, Approval approval)
    Return true if user can answer this approval or false if: - user is not approver of the passed in approval - the approval is not pending anymore - the issue that the approval belong to does not have the same current status as the approval configured - user already made decision
    getApprovalById(com.atlassian.jira.user.ApplicationUser user, int approvalId)
    Return an Approval for a given approvalId or AnError if: - user does not have permission to view issue in customer portal context - Approval was not found for the given approvalId
    getApprovalCommentConfig(com.atlassian.jira.user.ApplicationUser user, int approvalId)
    Return an ApprovalCommentConfig for a given approvalId or AnError if: - user does not have permission to view issue in customer portal context - Approval was not found for the given approvalId
    getApprovals(com.atlassian.jira.user.ApplicationUser user, ApprovalQuery approvalQuery)
    Retrieve a page of Approval of a particular ApprovalQuery
    getApprovers(com.atlassian.jira.user.ApplicationUser user, Approval approval)
    Return a list of Approver for a given approval
     
  • Method Details

    • newQueryBuilder

      ApprovalQuery.Builder newQueryBuilder()
      Returns:
      a new ApprovalQuery.Builder to build approval query
    • getApprovals

      PagedResponse<Approval> getApprovals(com.atlassian.jira.user.ApplicationUser user, ApprovalQuery approvalQuery)
      Retrieve a page of Approval of a particular ApprovalQuery
      Parameters:
      user - the user executing the query
      approvalQuery - the query to retrieve approval
      Returns:
      a paged collection of Approval
      Throws:
      ServiceDeskServiceException - on error
    • getApprovalById

      Approval getApprovalById(com.atlassian.jira.user.ApplicationUser user, int approvalId)
      Return an Approval for a given approvalId or AnError if: - user does not have permission to view issue in customer portal context - Approval was not found for the given approvalId
      Parameters:
      user - the user who is executing the action
      Returns:
      an Approval associated with the given approval id
      Throws:
      ServiceDeskServiceException - on error
    • getApprovers

      List<Approver> getApprovers(com.atlassian.jira.user.ApplicationUser user, Approval approval)
      Return a list of Approver for a given approval
      Parameters:
      approval - the Approval that we want to retrieve Approver from
      Returns:
      a list of Approver associated with the given approval
      Throws:
      ServiceDeskServiceException - on error
    • canAnswerApproval

      Boolean canAnswerApproval(com.atlassian.jira.user.ApplicationUser user, Approval approval)
      Return true if user can answer this approval or false if: - user is not approver of the passed in approval - the approval is not pending anymore - the issue that the approval belong to does not have the same current status as the approval configured - user already made decision
      Parameters:
      approval - the Approval that we want to check
      Returns:
      a boolean to indicate whether user can answer the given approval
      Throws:
      ServiceDeskServiceException - on error
    • answerApproval

      Approval answerApproval(com.atlassian.jira.user.ApplicationUser user, Approval approval, ApprovalDecisionType decision, ApprovalComment approvalComment)
      Answer to an approval of a given approvalId The answer could be approve or decline Required permissions: - User is an approver of the approval - User can view the request that the approval belongs to
      Returns:
      the updated Approval
      Throws:
      ServiceDeskServiceException - on error
    • answerApproval

      Approval answerApproval(com.atlassian.jira.user.ApplicationUser user, Approval approval, ApprovalDecisionType decision)
      Answer to an approval of a given approvalId The answer could be approve or decline Required permissions: - User is an approver of the approval - User can view the request that the approval belongs to
      Returns:
      the updated Approval
      Throws:
      ServiceDeskServiceException - on error
    • getApprovalCommentConfig

      ApprovalCommentConfig getApprovalCommentConfig(com.atlassian.jira.user.ApplicationUser user, int approvalId)
      Return an ApprovalCommentConfig for a given approvalId or AnError if: - user does not have permission to view issue in customer portal context - Approval was not found for the given approvalId
      Parameters:
      user - the user who is executing the action
      Returns:
      an ApprovalCommentConfig associated with the given approval id
      Throws:
      ServiceDeskServiceException - on error