Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements


  • Give kudos
  • My kudos


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get all customer request types from project key?

I want to write a groovy script to create a map of all request types with their keys for a given service desk. I've gotten it to work using the RequestTypeService class, but I can only get it to work using the Portal ID, not the Project Key. I'm probably missing something obvious. Any help would be greatly appreciated. Here's what I've tried so far:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.servicedesk.api.requesttype.RequestTypeService

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def requestTypeService = ComponentAccessor.getOSGiComponentInstanceOfType(RequestTypeService)
def reqQ = requestTypeService.newQueryBuilder().serviceDesk(2).build()
def reqT = requestTypeService.getRequestTypes(currentUser, reqQ)

def requestTypes = [:]
def requestType = reqT.right.results.toArray()
for (i = 0; i < requestType.length; i++) {
return requestTypes


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked in Jira Service Desk

Calling all Insight users, we need your help!

Hello Insight users,  As part of our (Mindville's) acquisition by Atlassian, our training team is looking to build some new Insight training materials. It would really helpful if you can ...

231 views 3 5
View question

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you