Interface ApprovalService
@PublicApi
@ParametersAreNonnullByDefault
@ReturnValuesAreNonnullByDefault
public interface ApprovalService
-
Method Summary
Modifier and TypeMethodDescriptionanswerApproval
(com.atlassian.jira.user.ApplicationUser user, Approval approval, ApprovalDecisionType decision) Answer to an approval of a givenapprovalId
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 toanswerApproval
(com.atlassian.jira.user.ApplicationUser user, Approval approval, ApprovalDecisionType decision, ApprovalComment approvalComment) Answer to an approval of a givenapprovalId
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 tocanAnswerApproval
(com.atlassian.jira.user.ApplicationUser user, Approval approval) Return true ifuser
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 decisiongetApprovalById
(com.atlassian.jira.user.ApplicationUser user, int approvalId) Return anApproval
for a givenapprovalId
orAnError
if: -user
does not have permission to viewissue
in customer portal context - Approval was not found for the givenapprovalId
getApprovalCommentConfig
(com.atlassian.jira.user.ApplicationUser user, int approvalId) Return anApprovalCommentConfig
for a givenapprovalId
orAnError
if: -user
does not have permission to viewissue
in customer portal context - Approval was not found for the givenapprovalId
getApprovals
(com.atlassian.jira.user.ApplicationUser user, ApprovalQuery approvalQuery) Retrieve a page ofApproval
of a particularApprovalQuery
getApprovers
(com.atlassian.jira.user.ApplicationUser user, Approval approval) Return a list ofApprover
for a givenapproval
-
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 ofApproval
of a particularApprovalQuery
- Parameters:
user
- the user executing the queryapprovalQuery
- the query to retrieve approval- Returns:
- a paged collection of
Approval
- Throws:
ServiceDeskServiceException
- on error
-
getApprovalById
Return anApproval
for a givenapprovalId
orAnError
if: -user
does not have permission to viewissue
in customer portal context - Approval was not found for the givenapprovalId
- Parameters:
user
- the user who is executing the action- Returns:
- an
Approval
associated with the given approval id - Throws:
ServiceDeskServiceException
- on error
-
getApprovers
Return a list ofApprover
for a givenapproval
- Parameters:
approval
- theApproval
that we want to retrieveApprover
from- Returns:
- a list of
Approver
associated with the given approval - Throws:
ServiceDeskServiceException
- on error
-
canAnswerApproval
Return true ifuser
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
- theApproval
that we want to check- Returns:
- a boolean to indicate whether
user
can answer the givenapproval
- 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 givenapprovalId
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 givenapprovalId
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 anApprovalCommentConfig
for a givenapprovalId
orAnError
if: -user
does not have permission to viewissue
in customer portal context - Approval was not found for the givenapprovalId
- Parameters:
user
- the user who is executing the action- Returns:
- an
ApprovalCommentConfig
associated with the given approval id - Throws:
ServiceDeskServiceException
- on error
-