Forums

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

How to know which issue fields are text types?

Ricard Juan Pujol June 12, 2019

I'm automating JQL query generation for searching any group of Issues based on any field an Issue could have.

I generate the JQL string using the EQUALS ('=') operator. The text fields don't support that operator. For those I have to use CONTAINS ('~'). But the problem is that I don't know the name of the issue fields that support one or other.

Using the JIRA REST API, how can I check or know which issue fields support which operators in an automated way?
How can I know wich issue fields are text fields or not?

PD: I know that I could generate manually an array that contained the issue fields that are text fields. But I want It to be fully automatic. Using the JIRA REST API .

2 answers

2 accepted

1 vote
Answer accepted
Ricard Juan Pujol June 13, 2019

There's also another solution I finally came with:

The operator CONTAINS('~') is allowed for fields of type string while the operator EQUALS('=') is allowed in anything else that is not a string.

You can check if a parameter is a string type or not, accessing the '/rest/api/2/field' resource.

1 vote
Answer accepted
Ravi Sagar _Sparxsys_
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.
June 12, 2019

Hi @Ricard Juan Pujol 

Interesting what you are doing.

Try this: /rest/api/2/jql/autocompletedata

Ravi

Ricard Juan Pujol June 12, 2019

Thanks, that was totally what I needed.


https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-jql-autocompletedata-get

Is there any way to get the same info using the Jirashell or the jira-python client?

Ravi Sagar _Sparxsys_
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.
June 12, 2019

Glad it worked. Not sure if these libraries have been updated with the autocompletedata resource.

Suggest an answer

Log in or Sign up to answer