Want to know the JQL statement which can provide the result as the no. of ticket has missed the baseline end date, based on the Baseline End date & Resolution date.
I tried with the below statement but it's not giving results due to limitation of clause.
Hi @jivan_patil
JQL can't compare two fields to each other — the right-hand side of a clause has to be a literal value or a function, so resolutiondate > "Baseline End Date" treats the field name as text. That's a JQL limitation, not a syntax issue.
The usual workaround is to have Automation record the result in a field you can query:
missed-baseline, or a checkbox / number field).{{issue.resolutiondate.diff(issue.Baseline End Date).days}} greater than 0. statusCategory = Done AND "Baseline End Date" is not EMPTY to backfill.Then your count is simply labels = missed-baseline (or whatever field you chose).
If you don't want to add fields, the other option is a JQL-extension app — several on the Marketplace support field-to-field comparisons in search.
Hi @jivan_patil
You can use ScriptGenie (full disclosure: I am the developer) to define custom JQL functions. See example below:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @jivan_patil,
The marker field plus Automation route is the right shape for this. One detail to check before you build it, because it silently inverts the result: the sign of the diff comparison.
Atlassian's own example is the giveaway. {{now.diff(issue.created).weeks}} returns -4 for an issue created four weeks ago, because when the second date is earlier than the first, the value comes back negative.
Applied to your case, {{issue.resolutiondate.diff(issue.Baseline End Date).days}} puts resolution first and baseline second. A ticket that missed its baseline has a baseline earlier than its resolution, so that expression is negative, and a greater than 0 condition would tag the tickets that finished early instead. Either use:
{{issue.resolutiondate.diff(issue.Baseline End Date).days}} less than 0, or{{issue.Baseline End Date.diff(issue.resolutiondate).days}} greater than 0I'd test the condition on two known tickets, one late and one early, and read the audit log before backfilling anything.
Two extras that tend to help here:
businessDays works as a unit, so .diff(...).businessDays gives a lateness figure that ignores weekends. .abs and .prettyPrint are available too if you want the number stored in a readable form.Worth adding Field value changed: Baseline End Date as a second trigger as well. Otherwise a re-baselined ticket keeps a marker that no longer reflects the dates.
Best,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A different angle worth knowing about, if the staleness of a stored flag concerns you: instead of recording the verdict, you can have it worked out at the moment you look.
My team builds JXL for Jira, which puts an editable table over your Jira data and lets a column hold an expression. The one you'd want here is:
CALENDAR_DATE_TO_DATE(this.baselineEndDate) < this.resolutionDate
That conversion is doing real work. Jira date fields carry no time of day, so they have to be converted before you can sensibly compare one against a timestamp like Resolution date.
Filter the column to the late tickets and the row count is your answer. Alternatively, put the same condition into a conditional formatting rule and let the late rows stand out on sight:

Since it's evaluated on read, re-baselining a ticket changes the verdict straight away, with no rule to re-run and nothing to backfill.
Regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.