Forums

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

JQL for searching json child element

Yida Li August 30, 2023

We have a custom field 1234 that I need to filter issues from a project on.  My jql is such:

 

"jql":  "project=JIRA and created < 2023-07-07 "
But I only want results that have the following attribute: 
customfield_1234.type.name = JIRA
How do I filter based on the above field?

1 answer

0 votes
Kseniia Trushnikova
Community Champion
August 30, 2023

Hi @Yida Li,

What is the type of your field customfield_1234? Is it a text field or a cascading select list?

Yida Li August 30, 2023

Hi @Kseniia Trushnikova the format of customfield_1234 is as follows:

 

customfield_1234: {
requestType: {
id: 1
}
}

I need to get the customfield_1234.requestType.id to filter from the search API.

Kseniia Trushnikova
Community Champion
August 31, 2023

@Yida Li, that's the field Customer Request type, right?

If so, the only way to search for it with JQL is by name or description, see more info here. You JQL should look like

project = JIRA and created < 2023-07-07 and "Customer Request Type" = "JIRA"
Yida Li August 31, 2023

That worked!  So in summary if you have a custom field mapped already in JIRA when filtering using JQL use the alias name

 

customfield_1234.requestType.name was mapped to 'Custom Field Name'

so in JQL i queried for 'Custom Field Name' ~ 'JIRA' 

Like Kseniia Trushnikova likes this

Suggest an answer

Log in or Sign up to answer