HI
I want to write a query along the lines of
project = JBIF AND status changed to (Implementing, "Implementation Held") AFTER Due
but i get the error
Date value 'Due' for predicate 'after' is invalid. Valid formats include: 'yyyy/MM/dd HH:mm', 'yyyy-MM-dd HH:mm', 'yyyy/MM/dd', 'yyyy-MM-dd', or a period format e.g. '-5d', '4w 2d'.
but it does work with AFTER startOfWeek() etc
I'm guessing the difference is a function rather than a field or the returned format.
So does anyoen have any pointers to writing a JQL function to 'wrap' an issue field?
We have Adaptavist scriptrunner. Any similar examples?
Tom
Community moderators have prevented the ability to post new answers.
It seems that dateCompare from ScriptRuuner should help you: https://scriptrunner.adaptavist.com/4.3.0/jira/jql-functions.html
i've looked at dateCompare but haven't found a syntax that works.
this is OK
project = JBIF AND status changed to (Implementing, 'Implementation Held') AFTER startOfWeek()
this isn't
project = JBIF AND status changed to (Implementing, 'Implementation Held') AFTER due
It looks as is status changed returns a date value but the formats are not comparable for built in fields or standard custom fields ( but i can compare due > startOfWeek() as a query but not
resolutiondate > duedate - I think this is why dateCompare was developed?)
tried dateCompare and expression as
project = JBIF AND issueFunction in expression("",status changed to (Implementing, 'Implementation Held') > due)
but syntax is not accepted.
My thoughts are to create a JQL function to wrap a date for use by AFTER. I was looking at an example - just an example based on issue data. most examples seem to be more generic system info functions.
will continue to research...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is a example for all issues with due date after resolution date:
issueFunction in dateCompare("","dueDate > resolutionDate")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thx Vasily , that works using dateCompare for straightforward criteria.
I was try to find a way to compare to the date an issue was in a state.
This is accepted
project = JBIF AND status changed to (Implementing, 'Implementation Held') AFTER startOfWeek()if there is a date available to reflect when an issue was moved to a state I can paraphrase as
project = JBIF AND status was in (Implementing, 'Implementation Held') AND issueFunction in dateCompare("", "duedate < My Event Date")So i either need to create and set a date in the workflow or create a JQL function that AFTER clause finds acceptable
(resolutionDate doesn't quite suit as the user wants to see issues in an intermediate state in quite a complex workflow moving through Review, Approval, Implementing, PostReview, Resolved)
As a JQL/Groovy newbie I was hoping for an example of creating a JQL function that accesses issue fields.
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.