I'm trying to get the service request in a validation script using scriprunner
But the script gets a different service than the chossen by the user.
@WithPlugin("com.atlassian.servicedesk")
RequestTypeService requestTypeService = ScriptRunnerImpl.getPluginComponent(RequestTypeService)
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def reqQ = requestTypeService.newQueryBuilder().issue(issue.id).build()
def reqT = requestTypeService.getRequestTypes(currentUser, reqQ)
def requestTypeName = reqT.right.results[0].getName()
log.warn("REQUEST TYPE " + requestTypeName)
if (requestTypeName == "Alpha"){
blah
}
WARN [jira.groovy]: REQUEST TYPE Beta
thanks in advance.