JQL query with Scriptrunner help

dennish_dcsorg_com January 21, 2020

I'm trying to run a query to list issues with comments from a certain year in a certain project, but I'm not having any luck. Here is what I'm running (JQL says the syntax is correct)

 

project = "My project" and lastCommentedDate >= endOfYear()

project = "My project" and lastCommentedDate <= endOfYear()

 

Results are coming back empty. I know there are many comments in the issues in this project.

1 answer

1 accepted

0 votes
Answer accepted
Kristian Walker _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.
January 22, 2020

Hi Denissh,

Thank you for your question.

Can I please ask you to navigate to the page located at <JiraBaseURL>/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/jql-sync?s=com.onresolve.jira.groovy.groovyrunner__jql-sync check if it says any issues need syncing. 

If any issues show as needing syncing then you can do this by clicking the blue *Sync All Issues* button at the bottom of the screen.

Once the issues have been synchronised then the correct properties will be stored against the issues meaning that they will be returned when using one of the JQL Keywords.

I hope this information helps.

Regards,

Kristian

dennish_dcsorg_com January 22, 2020

Ran the indexing, now I'm seeing results! Thanks. If I want to see only lastCommentDate of any time in 2016 what would the syntax be for that?

Kristian Walker _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.
January 22, 2020

Hi Denish,

Thank you for confirming that your issue has been resolved.

To see only comments in 2016 you would need to adjust the query to be similar to lastCommentedDate >= startOfYear(-4) AND lastCommentedDate <= endOfYear(-4) as this joins 2 queries together to search for issues between the beginning and end of the year which started 4 years ago.

I hope this helps.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer