How to use StartofYear(), EndofYear() in JIRA JQL?

I am trying to churn a report using JQL filter that displayed monthly ticket assigned to particular person in a year.

I am really confused regarding the usage of StartofYear() and EndofYear()

Since we only started using JIRA in November, below query should return data for the month of November (11M) but I am not sure why, the query below is not returning any data...

after startofyear("+11M") before endofyear("+11M")

From what I understand, the above query should return data from Starting of November to end of November right?


Solution 1:

The offset parameter in the startOfYear/endOfYear functions is the offset of whole years (e.g. startOfYear(-1) means start of the last year).

Also, you need to specify an object that you want to limit to these months (e.g. issues created or resolved). And you need to use different operators.

In your case, you need to use any of the following JQLs:

created >= startOfMonth(-1) AND created <= endOfMonth(-1) (for November when executed in December)

created >= 2021-01-11 AND created <= 2021-11-30

Instead of <= endOfMonth(-1) you can use < startOfMonth().

See also more information in Atlassian Documentation.