Approver JQL command is not finding issues with approvers that were created before workflow change

I have two issues: ASD-4 and ASD-86. Both share the same workflow: " ASD: Service Request Fulfilment workflow for Jira Service Management".

Both are in Stage “Pending” that has an approval step defined with field “Another Approver Field”.

In both issues I have the approver “Barbi Queue” with account id “5d52779aba0a060da21fdb29” in “Another Approver Field”

But the JQL command

“Approvals[Approvals]”=approver(“5d52779aba0a060da21fdb29”)

finds only one of them. The later one, that was newly created after the pending approval step was added. Is this intended behaviour?

If I change the stage back from Pending to In Progress and then again to Pending, then it is found.

Hello @m.schmidt

Is this happening for every single issue that passes through the workflow, or only those issues that were created before you added the pending approval step?

What are the values for the Another Approver Field and Status Categories fields for issues:

  1. Before they reach the pending approval step?
  2. After passing through the pending approval step and their status changing to either:
    A) Pending; or
    B) In Progress

Hello,

when they are before the pending approval step, then the JQL

“Approvals[Approvals]”=approver(“5d52779aba0a060da21fdb29”)

doesn’t find them. Also not after. And that’s what we need. To find them when they actually currently are in this step. It seems to work fine in the cases where the stage was reached after the added approval step and don’t work when the approval step is added after.

I’m not sure I understood your question, but please clarify if not.

I also dont know what the [Approvals] means, because it seems to work also without like

Approvals=approver(“5d52779aba0a060da21fdb29”)

Hello @m.schmidt

This seems to be a language issue. I’m not asking you about whether or not a particular JQL expression does or doesn’t ‘find’ any issues, I’m asking you to state what values particular fields have at particular stages in the workflow.

If the workflow is changing the values of fields, such as the status, of the issues, you need to know WHEN that change happens (IE, before, during or after the approval step), then you can compare that to WHEN the JQL does or does not result in a match. You are looking for correlations between the data. Since your JQL is only looking at one very specific field’s value, you need to find WHEN that field changes and WHAT are the circumstances of it changing.

The way you are expressing the problem, it sounds like you have a collection of issues that were created before you added that approval step to the workflow, and another set of issues that were created after you added that approval step to the workflow, and you are asking for some explanation as to how the two different workflows caused those two sets of issues to have two different states.