Using Date Functions in Scriptrunner dateCompare

ovidiu_vasilescu September 28, 2023

I'm trying to make a query that will show me all the issues that have a Start Date in the next 2 weeks.

In base JIRA, I can't do this because I can't give arguments to now(). 

In scriptrunner (cloud) in dateCompare, I can't seem to use now() even though the documentation says I can. Quote:
"You can use Date functions, for instance now(), startOfDay() etc, anywhere you would use a date."

However, when trying to compare against now(), it says it's not a valid field. Indeed, when looking at the Insert Function window for dateCompare, it's forcing me to select 2 fields from dropdowns to compare between. I cannot compare to a Date Function.

Am I doing something wrong?

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 10, 2023

Hi @ovidiu_vasilescu

Were you able to find a solution for this?

If not, could you please share the code that you have tested with so I could review it?

Thank you and Kind regards,

Ram

ovidiu_vasilescu March 6, 2024

Hi @ram 

Sorry for the late reply, I must have missed the notification about this.

I am trying something like this:
issueFunction in dateCompare("type = epic", "customfield_10015 < now() +2w ")
issueFunction in dateCompare("type = epic", "customfield_10015 -2w < now()")

and am getting this error:

Field: now() is not valid

 

Thanks,
Ovidiu.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events