Forums

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

Why does JQL yield only one issue?

Phil Bustin
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.
May 25, 2023 edited

I'd like to create a filter that will display any issues containing custom field "ID", and group the issues together if the value for "ID" is the same.

There are 3 issues, each a different issue type, all containing value "LSPP-295" for field "ID".

The only JQL I've tried that doesn't produce a syntax error is "ID = "LSPP-295", but it yields only one issue, not all 3.  I can open the other 2 issues using sub-task or related links contained in each issue.

If it matters, "ID" appears in the context section of each issue.

Questions I have:

1) Why don't all 3 issues display for the Search?

2) If the JQL can be modified to display all 3, can it also be modified to display all issues if they contain field "ID" and the field is not empty?

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
May 25, 2023

What type of project are these issues in; Team Managed or Company Managed?

Are the issues all in the same project or different projects?

What type of field is "ID"?

Phil Bustin
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.
May 30, 2023

The projects are Company Managed.

In this filter, the issues are in the same project.

"ID" is a Text field (single line).

Trudy Claspill
Community Champion
May 30, 2023

Searches based on text fields are are different than other fields. Details about how to specify filters for text fields can be found here:

https://support.atlassian.com/jira-software-cloud/docs/search-syntax-for-text-fields/

Review that document and let us know if you still have questions about the filter you are trying to construct.

Phil Bustin
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.
May 30, 2023

I had success with 

   Project in ("Team BADD") order by "ID" DESC

but go errors trying to add

   AND "ID" is not EMPTY

or

   AND ID is not EMPTY

I have not yet found, in the syntax document for which you provided a link, nor in Internet searches, a solution for querying whether the custom short text field is empty.

Trudy Claspill
Community Champion
May 30, 2023

Can you provide the complete and exact JQL you are using when you get an error trying to using "empty" with the ID field? 

Also show us the error message you are getting.

I have no error trying to compare a text field to EMPTY. I have tried with both a Team Managed project and a Company Managed project.

Phil Bustin
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.
May 30, 2023

Here are my two attempts:

not empty 1.jpg

not empty 2.jpg

Trudy Claspill
Community Champion
May 30, 2023

Can you show us the ID field within the screen that shows the list of custom fields?

When I add a custom field to a JQL statement it shows me the field type also:

Screen Shot 2023-05-30 at 11.22.52 AM.png

You should get a suggested match for your field when you start typing in "ID, similar to what I've shown above. Make sure you select the correct matching field.

 

Screen Shot 2023-05-30 at 11.24.12 AM.png

 

I am able to create a JQL that says

project=tka and ID is not empty

...and get the same error as you, but I don't have "ID" defined as a custom field. I think the message is misleading or maybe "ID" is a system field of some sort. I don't get a match for it when I start typing it in.

Screen Shot 2023-05-30 at 11.27.34 AM.png

Phil Bustin
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.
May 30, 2023

1) Suggested match for AND ID

SUGGESTED field.jpg

 

2) Suggested match for order by "ID"

SORT SUGGESTION.jpg

 

3) Query after selecting "ID Aa Short text"

suggestion clicked.jpg

Trudy Claspill
Community Champion
May 30, 2023

It appears that you have more than one custom field named "ID"; ID and id. Having multiple fields with the same name (case insensitive) can cause unexpected issues in JQL.

 

Can you try using the custom field number in the criteria instead of the text?

Project in ("Team BADD") and cf[10331] is not empty order by cf[10331] desc
Phil Bustin
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.
May 30, 2023

Thank you; that works, although I didn't find more than one 'ID', including in Trash.

Trudy Claspill
Community Champion
May 30, 2023 edited

Yes, but the potential matches when you typed ID into the JQL showed two fields; ID and id. In JQL terms are often evaluated without case sensitivity, so ID might be getting confused with id.

You may want to look into renaming the fields so that the names are unique.

Phil Bustin
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.
May 31, 2023

Interestingly, the custom field search only shows one "ID".  Its nearest match is "uuid".  Could "id" be a system field that doesn't appear in a custom field search?  

Regardless, I'll rename the field at least to avoid this conflict, and to make the name more meaningful. 

At present, the field contains an Epic key, but it will probably evolve to contain the issue key for a new project called "Initiative", from which Epics will be created, so the new name will likely be "Initiative ID".

Trudy Claspill
Community Champion
May 31, 2023

"id" could be a custom field in a Team Managed project. Those don't show up in the Custom Fields screen that Jira Admins use to create custom fields for Company Managed projects.

Suggest an answer

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

Atlassian Community Events