How can I remove duplicated issue keys from a query result

clarissa_ar March 27, 2020

Hi all,

I'm trying to run the following query, but I'm getting The issue key 'Duplicate' for field 'issuekey' is invalid.

project = <project_id> AND component = <component_id> AND ("Traceability Relevant" = Yes OR labels = <label_name>) AND status != Inactive AND (fixVersion != <v1> AND fixVersion != <v2> AND fixVersion != <v3> AND fixVersion is EMPTY) AND issuekey != Duplicate

How can I remove duplicated issue keys in the query result?

Also, I tried to use != and !~ in as a list to have a clean query, but it's not accepted: Operator '!=' does not support the list value '("v1", v2","v3)' for field 'fixVersion'.

I'm using Jira v7.13.8

Thanks!

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 29, 2020

You say "I need to remove duplicated issue keys [from a search result]"

Actually, no, you do not.  Jira already de-duplicates the list.   You are not getting the same issue key in the results.

The only way you might, which is rare, is when you have a very badly damaged index.  If that is the case, you desperately need to find out what is corrupting it, fix that, then run a full locking re-index.  Your duplicates will then vanish from your search results.

I'd be interested to see a screenshot of what is making you think you have duplicates.

0 votes
Leonard Chew
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.
March 27, 2020

Hi Clarissa

Providing you use the resolution to mark issues as duplicate, you can use: 

resolution != Duplicate 

Note: Many times the != operator needs to be combined with 'or myfield is not empty', if you can have empty values.

 

If you want to use list values in the query, you need to use the 'in' statement:

fixVersion in ('v1','v2')

 

Hope this helps, for more, read:

https://www.atlassian.com/software/jira/guides/expand-jira/jql#advanced-search

clarissa_ar March 27, 2020

Hi @Leonard Chew , 

I need to remove duplicated issue keys, not by duplicated resolution field.

I want to use a list that is not in that I already tried without success. 

Unfortunately, your suggestion didn't work for me.

Leonard Chew
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.
March 27, 2020

The issue key is unique. It is very, very unlikely that you have duplicate issuekeys.

What makes you think you have duplicate issuekeys?

Lonnie December 14, 2022

Is there JQL syntax which post-processes a query fragment to remove duplicated column values? For example: `project = MINE and assignee order by assignee UNIQ`

or something like that.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 14, 2022

No.  JQL returns a list of issues that matches the question of "what issues match these criteria".  It has nothing to say about what you report on or how.

Suggest an answer

Log in or Sign up to answer