JIRA Script Runner dateCompare gave error: Field name: XXX not found or not a date or datetime.

Royce Wong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2016

JIRA 6.2.2, ScriptRunner 3.0.16

The following JQL:

issueFunction in dateCompare("'", "created + 3h > Date of First Response")

gave errors:

  • Field name: Date of First Response not found or not a date or datetime.
  • Use a comparison like: "dueDate > resolutionDate", or "dueDate > resolutionDate + 2w", or "My Date Custom Field > My Other Date Custom Field"

I've tried replacing Date of First Response with followings but didn't work:

  • DateofFirstResponse
  • dateofFirstResponse
  • dateOfFirstResponse
  • dateoffirstresponse

In my JIRA instance, Date of First Response field is list as type: Date of First Response (yes same name) rather than of type: Date Picker.

However, referencing https://scriptrunner.adaptavist.com/4.3.1/jira/jql-functions.html, this works:

issueFunction in dateCompare("", "created + 3h > firstCommented")

but I am not sure where @Jamie Echlin [Adaptavist] got firstCommented field from, is it the same as Date of First Response? If not, what's the fix for my JQL issue?

Thanks.

1 answer

1 accepted

1 vote
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2016

"firstCommented" can be thought of as a custom field, although it is not one. It's something you can use in your queries as described at https://scriptrunner.adaptavist.com/4.3.1/jira/jql-functions.html#_dates.

dateCompare does not support that field type "Date of First Response" - there are various issues to get expression and dateCompare to work with more custom field types.

 

Royce Wong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2016

Thanks for the fast response Jamie.

sad Sad that DateCompare doesn't work with "Date of First Response"/expression field types.

I did some experiments and concluded that "firstCommented" is not the same as "Date of First Response", please correct me if I am wrong.

Suggest an answer

Log in or Sign up to answer