-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Work Item - Search - Backend - JVIS
-
2
-
Minor
-
4
Issue Summary
Using "assignee in (...)" with display names will result in inconsistent results. Notably, this problem cannot be reproduced when executing the JQL directly in the issue navigator, but it happens when the JQL is executed within a Jira expression. This bug seems to be limited to names and does not impact account IDs added through JQL autocomplete.
Steps to Reproduce
- Open the issue navigator or dashboard for the URL: +[https://Url
- Access the browser console and execute the script provided below:
var jql = `key <= ISSUE-2000 and assignee in ("Full name")` var searchUrl = `/rest/api/3/search?jql=${encodeURIComponent(jql)}&validateQuery=warn&maxResults=0&fields=id` var evalUrl = "/rest/api/3/expression/eval"; for(let i=1; i<=50; i++) { var totals = await Promise.all(Array(6).fill().map((_, i) => i%2 ? fetch(`${searchUrl}&_r=${Date.now()}`).then(r=>r.json()).then(r => r.total) : fetch("https://<URL>/rest/api/3/expression/eval", { "method": "POST", "headers": { "content-type": "application/json" }, "body": JSON.stringify({ "expression": "issues.map(issue => issue.id)", "context": { "issues": { "jql": { "query": `${jql} order by updated asc`, "maxResults": 500 } } } } ), }).then(r=>r.json()).then(r=>r.meta.issues.jql.totalCount))) if(new Set(totals).size == 1) console.log(`Run ${i} had identical totals`); else { console.error(`Run ${i} had different totals:`, totals); break; } }
3. check the output after a few runs there will be a miss match in the number of results returned
Thanks to Qotilabs for the script.
Expected Results
Identical results in every run
Actual Results
Different results after a few runs
Run 6 had different totals: (6) [412, 352, 378, 378, 378, 263]
Workaround
Use Account IDs instead of display names
Notes:
Queries that return 100 – 500 issues and 10 ~15 display names can be used to reproduce the issue easily.