Getting deleted/unexisted issues by filter

Answered

Hello.

I tried to get some information about issues by query:

/rest/issue?filter=issue+id%3A+TEST-2262%2C+SIP-1118%2C+TEST-2607%2C+TEST-245

The issue with id TEST-245 is not existed (may be was deleted), so I expected to get all other. But the response is completely empty (contains only one empty "<issueCompacts/>" tag). How can I get info about all existed issues with "filter" query? Or it's possible with some another way?

Thanks.

 

9 comments
Comment actions Permalink

Hello Pavel, when you perform this search in the YouTrack UI, what do you see? Could you please attach a screenshot with the full page visible?

Thanks.

0
Comment actions Permalink

Yes, here it is:

0
Comment actions Permalink

Oh, sorry, that's one:

0
Comment actions Permalink

Pavel, the thing is that when you're trying to search for an issue that doesn't exist, your search query becomes invalid (there is no such issue id). That's why the search doesn't work in that case.

Unfortunately, it's not possible to show only the existing issues from the list in the current search implementation.

0
Comment actions Permalink

It's a pity. Will it be fixed in the future? Cause it makes search impossible for some cases.

0
Comment actions Permalink

Pavel, no, it's a feature of the search. You need to check the search query syntax for being valid, otherwise, search doesn't work.

If you're looking for a issue id that doesn't exist, it makes your search query invalid.

 

As a workaround, we can suggest searching for issues like this: `(TEST-2262) or (SIP-1118) or (TEST-245)`

This search will return all existing issues and not break the search. It's important not to put there any `#` symbols or `issue id:` because it'll limit the search and break it all the same. If you search for issues like mentioned above, the part with the deleted issue is interpreted as a simple text search and doesn't break the query.

0
Comment actions Permalink

 "it's a feature of the search ... If you're looking for a issue id that doesn't exist, it makes your search query invalid." - imho, sounds quite strange. Any chance to this feature be unimplemented in time?

The query with 'or' works but returns a huge redundant result. Is there any other way?

0
Comment actions Permalink

Pavel, unfortunately, we don't have a plan to change this behavior anytime soon. A fix like this would bring a number of new issues to our search and break other use cases.

As another workaround, I can recommend you to make all these issues that you're searching for share some common property, for example, a tag or a custom field value. Then you'll be able to search for them using this common property in the search.

0
Comment actions Permalink

I sse. I'll think about tags, thanks for help.

0

Please sign in to leave a comment.