In a script, I call:
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
Seems to work just fine in:
def eitherRequestTypes = requestTypeService.getRequestTypes(currentUser, requestTypeQuery)
But, later on, I call:
def portal = portalService.getPortalForProject(currentUser, portalId)
This gives me an error:
No signature of method: com.atlassian.servicedesk.internal.feature.customer.portal.PortalServiceImpl.getPortalForProject() is applicable for argument types: (com.atlassian.jira.user.DelegatingApplicationUser, java.lang.Integer)
What?
Do I cast it? Should I have used another way to get an ApplicationUser? Why does it work in one method that has the same signature as another in the same software?