I am trying to capture if my team met/missed SLA for all the tickets assigned.
The definition of met SLA is if the status of a ticket changed FROM In progress TO “ready for Peer Review” 2 days or more prior to expected completion date.
if the status did not change at least two days before expected completion date- team missed SLA.
please help with a JQL that can pull these met/missed SLA tickets.
What version of Jira Service Management are you using?
Have you reviewed the options for setting an SLA?
I've not spent a lot of time working with Service Management SLAs. I took a quick look, and it doesn't seem like the features there will suit your needs.
You might be able to construct a search filter that would find the issues that match that criteria, and then us a periodic subscription to send an email with the filter results.
You can use the CHANGED operator to evaluate the change from one status to another occurred on/before/after/during dates, but you can't have that comparison being made to a date in another field.
You could filter for issues where the "expected completion date" is less than or equal to 2 days from now, and find issues that are in the In Progress status.
"expected completion date" > now() and "expected completion date" =< 2d and status = "In Progress"
That would not tell you if the issue had previously transition to Peer Review and then transitioned back to In Progress. Would it matter if the issue had transitioned to Peer Review previously?