I'm trying to create a Jira issue from a Scriptrunner script, but on create I'm given this error message:
Anonymous users do not have permission to create issues in this project. Please try logging in first.
I have credentials I can use to authenticate, but I don't know how to set them. I've tried the following calls, but they are not working (some appear to only check if you *know* the credentials, not to actually authenticate.
LoginService.authenticate(ApplicationUser, "password")
AuthenticationContext.setLoggedInUser(ApplicationUser)
ComponentAccessor.getJiraAuthenticationContext().setLoggedInUser(ApplicationUser)
Any ideas how to authenticate?