I'm using scriptrunner's issuefunction expression to compare two custom date fields in a jql. Example: issueFunction in expression("", "dateField1 < dateField2"). I'm having trouble when one of the custom fields have a dash in it, scriptrunner doesn't recognize the name of the field. When a field is called "date field 1", writing datefield1 on scriptrunner works. When a field is called "date - field 1", writing date-field1 on scriptrunner does not work.
Is there a particular way to escape dashes for custom field names in that situation?
That seems to result in an "java.lang.ClassCastException: null" error. I also tried it with system fields to make sure it wasn't an issue with the custom fields, the query
issueFunction in expression("", "\"updated\" < created")
results in that error, while if I remove the escaped quotes
issueFunction in expression("", "updated < created")
it works fine, returning zero results without any error.
Hi, I'd like to second the question. I have exactly the same issue. I want to compare two custom fields with dates
issueFunction in dateCompare("", "Date of deployment INT > Date of deployment UAT")
works fine, similar field but different environment crashes:
issueFunction in dateCompare("", "Date of deployment INT > Date of deployment PRE-PROD")
with an error:
Field name: Date of deployment PRE not found or not a date or datetime.
Is there any way to overcome that?
Could it be because you have "-" in your field name? Maybe quote escape so it doesn't attempt to parse the hyphen as a "minus" operator?
issueFunction in dateCompare("", "Date of deployment INT > \"Date of deployment PRE-PROD\"")
Then the parser should treat Date of deployment PRE-PROD as a a single entity rather than "Date of deployment PRE" <minus> "PROD"
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events