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

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

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

Hi Richard,

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

Kind regards,

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Mar 09, 2018 in Jira Service Desk

E.L. Fridge's take on education, Jira Service Desk, and creative Jira use cases

...word of mouth, so by 2016, we were working with several other entities on campus to implement Jira Service Desk . The Atlassian motto of “for every team” has really come true for us in this case. We...

1,234 views 2 14
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you