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: 

JQL query with Scriptrunner help

Dennis_H
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Champion
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

Dennis_H
Contributor
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 Champion
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

TAGS
AUG Leaders

Atlassian Community Events