Rest API call to search issues with OR operator

Natalia Tarnopolsky January 31, 2016

Hi,

I'm making following REST api call to my on-demand JIRA instance.

https://myjira.atlassian.net/rest/api/2/search?fields=summary&jql=(key=AAAA-11) OR (key=AAAA-10)

 issue with KEY AAAA-11 is deleted from my system, so since it is OR operator i'm expecting to get information of AAAA-10 issue in such case (it does exist on system) but I'm getting an error response - 

{
"errorMessages": [
"An issue with key 'AAAA-11' does not exist for field 'key'."
],
"errors": {}
}

Please advice.

Thanks,

Natasha

1 answer

0 votes
Vasiliy Zverev
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.
January 31, 2016

If you need to look for number of issue keys it is better to use "key in (AAAA-10, AAAA-11)". In this case you will not get an error if some key is not present into system.

Natalia Tarnopolsky January 31, 2016

@Vasiliy Zverev , thank you for quick answer!

Unfortunately got same error with this one - 

jira.jpg

Vasiliy Zverev
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.
January 31, 2016

You are making this REST via some JIRA user. Are you sure that this user has a permission to browse this issue?

Natalia Tarnopolsky February 1, 2016

@Vasiliy Zverev

yes, this is Admin user.

if I make call with jql=key in (AAAA-10)

JIRA returns me the AAAA-10 issue.

AAAA-11 is deleted.

Suggest an answer

Log in or Sign up to answer