Is it possible to apply IN clause on custom fields

Laxminarsaiah Ragi January 8, 2020

Hi There,

I want apply IN clause on custom fields to get the data in one query instead of polling multiple times is it possible?

My current query:

for item in items:

        jql = ('status in ("Resolved") AND priority=P1 AND resolutiondate >= "-1d" and 'cf[1111]~{0}'.format('"' + item+ '*")

I am expecting:

jql =   ('status in ("Resolved") AND priority=P1 AND resolutiondate >= "-1d"                 and 'cf[1111] IN({})'.format('"' + item1+ '",'"+item2+'"','"+item3+'"')

 

Please help me

Thank you

Laxmi  

 

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2020

Hey there @Laxminarsaiah Ragi ,

Of the IN clause as an operator directly in the JQL, It fully depends on the custom field type as covered in the documents "Advanced searching - fields reference: Custom Fields" for supported operators which the IN clause falls into: 

Different types of custom field support different operators.

Looking at your query your using the "~" operator for a approximately related value returned within the following string, indicating a text field is in use as a the "~" operator is generally unsupported for custom fields but Jira text-search syntax can be used with custom fields of type 'Text'. 

So to get a better understanding of the full query What is the custom field type and searcher for the field? It might be that the searcher doesn't allow the in use operator for this field.

Regards,
Earl

Suggest an answer

Log in or Sign up to answer