Filter Issues by a number of item numbers? I can't get it to work somehow.

Seb July 15, 2021

Hello all,

I think the solution is only possible with JQL, but unfortunately I haven't found a way yet and hope you can help me.

I have created a custom field "article number" and there are numerous issues for different item numbers.

For Example:
SharedScreenshot.jpg

I have a list of article numbers on my desktop (about 50 article numbers). I would like to filter the corresponding issues for the list of article numbers (i think can copy and paste them into a JQL formula).

Translated into simple words, my function would be:
Find me the matching issues from the project (project name) for the following item numbers (123456, 567893, 123532).

8 answers

2 votes
Payne
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, 2021

This ought to work for your needs.

project = "My Project" and "Article number" in (123456, 567893, 123532)

1 vote
Seb August 31, 2021

@Payne 
Okay, then I'll just have to think around the corner a bit next time. This is exactly what I was looking for. Great, thank you very much!

1 vote
Payne
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.
August 30, 2021

Glad it helped, Seb! You could utilize a tool outside of Jira, such as a text editor or Excel, for constructing your JQL. For example, if you had a column of article numbers in Excel, you could then in the next column use a function like this:

=CONCATENATE("""Article number"" ~ """,A1,""" OR ")

Copy and paste it down the column, and then copy that column's values and paste it into your JQL query (remove the final "OR").

jira.PNG

1 vote
Seb August 26, 2021

@Payne 

Finally I had another project where i could test the function. it works, thank you very much!

Another thing I haven't found yet is what to do if I have e.g. 30 article numbers in a list. How can I process this as quickly as possible? Because always separating with "Article number" ~ "096542" OR "Article number" ~ "094785" would be very time-consuming.

1 vote
Payne
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 16, 2021

In that case you can do similar to what you provided, but use OR rather than AND (think of the logic; using AND means the article number must match all the values you provide, which is impossible for any given issue), and enclose your values in quotes to allow for embedded spaces, e.g.

project = "My Project" AND ("Article number" ~ "382020" OR "Article number" ~ "081577" OR "Article number" ~ "023456 323")

0 votes
Randall Strother July 21, 2021

Thanks for your input here. I hope this could be helpful for the OP. lOl!

0 votes
Seb July 15, 2021

Thank you very much so far @Payne 

I forgot to mention that the custom field "article number" is a text field (single line). Then it doesn't work in this case, at least it didn't work. Do I have to change the field to "numeric"? But if I change the custom field from text field (single line) to numeric, I lose the leading zero, right? That doesn't help me. I know, I can't change the format, but I can create a new custom field and import the old data.

My idea so far:

project = "My Project" AND "Article number" ~ "655013"

But it does not yet work with different article numbers.

This one doesn't work:

project = "My Project" AND ("Article number" ~ 382020 AND "Article number" ~ 081577)

Another addition:
If an article number has a space between the numbers, there are also problems, aren't there? So sometimes an article number is not just "123456" its more like "023456 323".

Many thanks in advance

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 15, 2021

Payne's solution should be what you need!

Suggest an answer

Log in or Sign up to answer