I'm trying to write script to notify approvers via slack ot issue transition.
I choose script listener (not post-finction) due to large number of possible transitions.
So how to do following:
- Detect if issue require approval
- Get list of approvers (later with their descisions)
I've done that before on cloud version via REST API, there is no problem with that, but in server version I've got original issue (not after transition) so there is no approval yet in moment of transition. I've try to access approval custom field, but there is no approvers info in it. I've try to search examples how to work with approvals in scriptrunner, but no dice. I've try following code to test jira java api, but it's not working...
@WithPlugin ("com.atlassian.servicedesk")
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.servicedesk.api.approval
def issue = ComponentAccessor.getIssueManager().getIssueObject("DVPT-1")
ApprovalQuery query = approvalService.newQueryBuilder().issue(issue).build()it shows error about "ApprovalQuery" class. What I need to import to have it?
How to work with approvals?