If I run a JQL query to bring back the Rank of an issue, I am getting a different value to the value obtained by running an SQL query directly on the database meaning issues in my spreadsheet appear in a different order to how they appear in JIRA. Am I missing a join somewhere?
For example, in JQL the rank for issue XXX-650 is 4597.
If I query the database directly with the following SQL query, I get 5660.
SELECT
public."AO_60DB71_ISSUERANKING"."ID"
FROM
public."AO_60DB71_ISSUERANKING",
public.jiraissue
WHERE
public.jiraissue.pkey = 'XXX-650' AND
public."AO_60DB71_ISSUERANKING"."ISSUE_ID" = public.jiraissue.id
Is the ID of the ISSUERANKING table the Rank value used by JIRA? From other answers, I think so. In the database, if I look for the issue with the Rank 4597, it is a completely different issue (of course).
Any guidance would be much appreciated.