Search for issue key only, not ID

The Jira REST API (json) allows to search for an issue by its key/id. However, the API will return a match on either of them. Is it possible to search for the key value only? Even the queries will return match on both, even if only the key is specified.

1 answer

1 accepted

0 votes

I don't understand the question.  It's two methods to get one result.  You don't have to use the id.

My use case is that I need to try different IDs to see if any of them is a Jira issue or not. One such ID can be for example PROJ-001, or just a number like 123456. These IDs can be IDs for many different ALM systems, Jira is just one of them.

So when I try to search for an ID in Jira, both examples above can actually return a Jira issue, because the API is searching for both ID and KEY fields. I have not yet found any way to restrict the search to only one of them.

There is a workaround for sure (I can check the result's ID and KEY fields), but if there is a better way to search, it would be more optimal.

Ah, you're using wild or quick searches that go across fields.

Simple answer is "don't".  Or if you're going to look for a something that is not a JIRA issue key, use "and id != <what I'm searching for>"

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,831 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot