The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Hyphen in date custom field name doesnt work in datecompare

Mayuresh Sakharape
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Moses Thomas
Community Champion
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 Champions.
November 8, 2019

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

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

Mayuresh Sakharape
Contributor
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 Champions.
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
Contributor
November 8, 2019

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

Moses Thomas
Community Champion
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