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 givenapprovalIdThe 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 givenapprovalIdThe 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 ifusercan 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 anApprovalfor a givenapprovalIdorAnErrorif: -userdoes not have permission to viewissuein customer portal context - Approval was not found for the givenapprovalIdgetApprovalCommentConfig(com.atlassian.jira.user.ApplicationUser user, int approvalId) Return anApprovalCommentConfigfor a givenapprovalIdorAnErrorif: -userdoes not have permission to viewissuein customer portal context - Approval was not found for the givenapprovalIdgetApprovals(com.atlassian.jira.user.ApplicationUser user, ApprovalQuery approvalQuery) Retrieve a page ofApprovalof a particularApprovalQuerygetApprovers(com.atlassian.jira.user.ApplicationUser user, Approval approval) Return a list ofApproverfor a givenapproval
-
Method Details
-
newQueryBuilder
ApprovalQuery.Builder newQueryBuilder()- Returns:
- a new
ApprovalQuery.Builderto build approval query
-
getApprovals
PagedResponse<Approval> getApprovals(com.atlassian.jira.user.ApplicationUser user, ApprovalQuery approvalQuery) Retrieve a page ofApprovalof 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 anApprovalfor a givenapprovalIdorAnErrorif: -userdoes not have permission to viewissuein customer portal context - Approval was not found for the givenapprovalId- Parameters:
user- the user who is executing the action- Returns:
- an
Approvalassociated with the given approval id - Throws:
ServiceDeskServiceException- on error
-
getApprovers
Return a list ofApproverfor a givenapproval- Parameters:
approval- theApprovalthat we want to retrieveApproverfrom- Returns:
- a list of
Approverassociated with the given approval - Throws:
ServiceDeskServiceException- on error
-
canAnswerApproval
Return true ifusercan 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- theApprovalthat we want to check- Returns:
- a boolean to indicate whether
usercan 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 givenapprovalIdThe 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 givenapprovalIdThe 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 anApprovalCommentConfigfor a givenapprovalIdorAnErrorif: -userdoes not have permission to viewissuein customer portal context - Approval was not found for the givenapprovalId- Parameters:
user- the user who is executing the action- Returns:
- an
ApprovalCommentConfigassociated with the given approval id - Throws:
ServiceDeskServiceException- on error
-