Skip to content

Instantly share code, notes, and snippets.

@jechlin-adaptavist
Created July 14, 2020 14:45
Show Gist options
  • Save jechlin-adaptavist/648d0258c33ea3d21544d6dfc190dba2 to your computer and use it in GitHub Desktop.
Save jechlin-adaptavist/648d0258c33ea3d21544d6dfc190dba2 to your computer and use it in GitHub Desktop.
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.servicedesk.api.requesttype.RequestTypeService
@PluginModule
RequestTypeService requestTypeService
def request = requestTypeService.newQueryBuilder()
.issue(event.issue.id)
.build()
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
requestTypeService.getRequestTypes(loggedInUser, request).findFirst().ifPresent {
log.debug(it.name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment