Hyphen in date custom field name doesnt work in datecompare

Mayuresh Sakharape November 8, 2019

Hi,

We want to use datecompare in JQL function with customfield dates.

The date field name is Q-Date.

The JQL looks like

issueFunction in dateCompare("","QA Date> Q-Date")

'-' is considered as minus. and get below error

"Scripted function "dateCompare" compilation failure. Contact administrator and check logs. Message: Field name: Q not found or not a date or datetime."

 

How to esacpe the hyphen in customfield name

2 answers

1 accepted

0 votes
Answer accepted
Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 14, 2020

@Mayuresh Sakharape   I have the solution for this problem once you are login in as admin  got to customfield setting to  get the custom field id's  of  the dates  field in order to compare them

Custom fields > search for field name > edit and you will find the id on the browser link.

 

Now  with the script runner plugin ( latest version) type the query below.



issueFunction  in  expression ("",  "customfield_id1 > customfiled_id2")

 

Kind regards,

Mo

0 votes
Ilya Turov
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.
November 8, 2019

just quote fieldnames(with a single quotes inside, if outside are double)

issueFunction in dateCompare("","'QA Date' > 'Q-Date'")

Mayuresh Sakharape November 8, 2019

Hi Ilya,

It doesnt work. After quotes, it doesn't even identify first date field.

Ilya Turov
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.
November 8, 2019

yeah, it's weird

they also recommend using customfield_12345 instead of field name, if it contains any "punctuation", but I also couldn't get it to work

Mayuresh Sakharape November 8, 2019

yes, its not working. I tried it with customfield_12345 or cf[12345]. But no success.

Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 9, 2020

Dear Adaptivist,

 

Please could you solve this issue ?

Has any one solved this issue ? i think that this is a bug

 

Best regards,

Mo

Like # people like this

Suggest an answer

Log in or Sign up to answer