Filtering JIRA issues by specific fixVersion ID using REST API

Hey folks, I’m stuck trying to get JIRA issues with a certain fixVersion ID. I want to fetch issues that have 15824 as the id in the fixVersions field. The tricky part is that fixVersions can have multiple entries.

Here’s what I’ve tried:

/rest/api/2/search?jql=project=MYPROJECT&fixVersion=15824&fields=id,key,fixVersions

But it’s not working as expected. I’m getting issues with other fixVersions and sometimes even issues without any fixVersions.

I need help crafting the right query to get only issues where at least one of the fixVersions has an id of 15824. Any ideas on how to make this work? Thanks in advance for your help!

Have you considered using the JQL ‘in’ operator with a subquery? This approach might solve your problem. Try something like this:

jql=project=MYPROJECT AND fixVersion in (15824) AND fixVersion is not EMPTY&fields=id,key,fixVersions

This query ensures that 15824 is among the fixVersions and that the fixVersions field isn’t empty. It should filter out issues without any fixVersions.

If you’re still getting unexpected results, it might be worth checking your JIRA instance’s indexing status. Sometimes, outdated indexes can cause inconsistent search results. You may need to ask your JIRA admin to reindex if this is the case.

Also, ensure you’re URL encoding the JQL query properly when making the REST API call. Special characters can cause issues if not encoded correctly.

hey harry, have u tried using the ‘was’ operator? it might help. try this:

jql=project=MYPROJECT AND fixVersion was 15824&fields=id,key,fixVersions

this should catch issues where 15824 was a fixVersion at any point. lemme know if it works for ya!

I’ve encountered a similar issue before, and I found a solution that might work for you. Instead of using fixVersion=15824, try using the ‘in’ operator with the specific ID. Here’s the JQL query that should do the trick:

jql=project=MYPROJECT AND fixVersion in (15824)&fields=id,key,fixVersions

This query will return issues where 15824 is one of the fixVersions, even if there are multiple versions listed. Make sure to URL encode the query when you use it in your REST API call.

If you’re still having trouble, you might want to double-check that the fixVersion ID is correct and that you have the necessary permissions to view the issues. Sometimes JIRA’s permission settings can affect what results you get back from the API.

Hope this helps! Let me know if you need any further clarification.