Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Request Type Field Populated Within Jira Issue but not Present within XML File?

Varad Bhatt July 9, 2024

Hi everyone,

I am trying to check whether the Request Type field is empty or not within my Jira ScriptRunner code. The field is populated on the ticket, but when I extract it using issue.fields[RequestTypeID].toString(), it is always returning null. I exported the Jira issue as an XML file and searched the customfieldID corresponding to the Request Type field within the file and no value shows up underneath the field (please see image below). 

Has anyone encountered an issue similar to this in the past? Checking whether the field is null or not is essential for the functionality I am trying to implement within ScriptRunner so any help would be greatly appreciated. 

Empty Field.jpg

1 answer

0 votes
Matt Parks
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.
July 9, 2024

Do you have multiple custom fields with the name of Request Type? If so, I assume that the customfield ID listed is correct, but it's a simple fix if that's the problem.

Varad Bhatt July 10, 2024

Hi Matt, 

Thanks for responding. 

There is only one custom field with the name of Request Type within the Jira ticket and within the XML file as well. 

Varad Bhatt July 15, 2024

Hey @Matt Parks , 

I just wanted to follow up and see if you had any further suggestions to troubleshoot this issue. 

Thanks. 

Matt Parks
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.
July 15, 2024

I have almost never used Scriptrunner on Cloud, so the code ends up being pretty different than what I write for Data Center.

But maybe, instead of getting the value of the field, you actually have to get the Option that is selected and then get the name of the selected Option? Or maybe you need to see if the Option is null?

I'm assuming that Request Type is a select field. I think you might even need to write it differently if it's a single-select as opposed to a multi-select, but I honestly don't know for sure.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events