I have the following code that worked before upgrading to Jira 8/ServiceDesk4 but now it does not and I have not been able to find a replacement for this. This is in a listener and I am just needing to get the request type.
def requestTypeEither = ComponentAccessor.getOSGiComponentInstanceOfType(RequestTypeService).getRequestTypes(curUser,sourceIssueRequestTypeQuery)
if (requestTypeEither.isLeft()) {
log.error "${requestTypeEither.left().get()}"
return
}
def requestType = requestTypeEither.right.results[0]
What is the new method?
Finally figured it out.
Have to change:
def requestType = requestTypeEither.right.results[0]
to:
def requestType = requestTypeEither.results[0].getName()
Mean to include, the error i'm getting is:
groovy.lang.MissingPropertyException: No such property: right for class: com.atlassian.servicedesk.api.util.paging.PagedResponseImpl at Script171.run(Script171.groovy:38)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
seems like there has been some changes, in my former code I supposed
com.atlassian.servicedesk.api.requesttype.RequestTypeService.getRequestTypes to return a
com.atlassian.fugue.Either
so this faild although it was working before:
def requestTypes = requestTypeService.getRequestTypes(currentUser, requestTypeQuery)
return (requestTypes?.right?.results[0]?.getIssueTypeId()).toString()
just changed it to something like:
requestTypes?.findFirst()?.get()?.name
or
requestTypes?.each{ ... }
regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.