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

How can I use Goovy to populate a custom field with Customer Request Type?

Richard Saffell February 12, 2015

I want to be able to create reports on what Customer Request Type was used when creating an Issue in Service Desk.  For example, was the "General" request type selected, or was a specific one used.

I was thinking that the easiest thing to do might be to populate a custom field with the Customer Request Type on Issue Create.

I already have a Groovy script setup in the Workflow on Issue Create, but I'm not sure how to access the Customer Request Type value from the issue.  So I think I just need to know how to get that value and I can set my custom field value to that same value for future reporting.

2 answers

0 votes
Tom Moors
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2015

Hi Richard,

You can find probably find an answer to your question here: https://answers.atlassian.com/questions/9873288

Kind regards,

0 votes
Alejo Villarrubia [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2015

Hi Richard,

Customer Request Type is just a custom field, which means that you can retrieve its value calling issue.getCustomFieldValue:

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def reqTypeCF = customFieldManager.getCustomFieldObjectByName("Customer Request Type")
def reqType = issue.getCustomFieldValue(reqTypeCF)

Hope that helped

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events