Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Dynamic date range for a custom chart

Colum McAndrew March 11, 2024

Hi. I'm experimenting with a custom chart. I'm using the "Created vs Resolved" template, but changing the settings to my requirements. 

I want to use a dynamic date range of the last three months. As today is in March, this means the date range should be 1 December 2023 to 29 February 2024.

Where I'm struggling is understanding the syntax of the From and To fields. I've tried using -3m and -1m but this returns no data. Any ideas what I'm doing wrong?

dynamic_filter.png

3 answers

2 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Colum McAndrew March 12, 2024

For the benefit of anyone else who may fall upon this thread...

I've changed the custom chart settings to use our Jira project as the Source, but use a "Between dates" range. It means having to update the range each time I need the metrics, but that doesn't take long.

jira.png

1 vote
Answer accepted
Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 11, 2024

Hi @Colum McAndrew

I don't have the plugin installed myself to test it. But in Jira the 'm' stands for minutes.

You could try to do it in days: -90d and -30d for example. Or with a capital M

Colum McAndrew March 11, 2024

Thank you @Charlie Misonne. There's me thinking "m" equaled months. I've tried the capital M but that doesn't make a difference. I've also tried using -1q (q for quarter) but that isn't valid.

Unfortunately using 90 days isn't quite what I want. To use my earlier example, the quarter (Dec to Feb) is 91 days. Jan to Mar would also be 91 days, but Feb to April would only be 90. So using an absolute value won't work.

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 11, 2024

Ok that makes sense.

I don't think it can be done with the dynamic range. I tried several options myself.

If you change your datasource to a custom JQL you could use this:

(created > endOfMonth(-4M) AND created < endOfMonth(-1M)) and (resolved > endOfMonth(-4M) AND resolved < endOfMonth(-1M))

You can read more about the endOfMonth() JQL function on teh JQL functions documentation.
endOfMonth() without parameter would be 31 March. endOfMonth(-1M) is the previous month so 29 February and endOfMonth(-3M) is 30 November. startOfMonth() also exists.
Unfortunately the custom chart dynamic range does not seem to accept these functions. That's why you need to use a JQL as datasource instead of whatever you are using now.
And for range you pick all dates.

Here is mine, as you can see it only displays data of DEC, JAN, FEB:

chart.png

If it's still not what you're looking for I'm sure you can ask the vendor for help via a support ticket :-)

0 votes
Colum McAndrew March 12, 2024

Thanks Charlie. That's definitely closer to the solution I want. What is bizarre is how the created and resolved totals are the same. I've tried this on other date ranges also and the same happens. I'm pretty sure that's not right.

Anyway I'll contact the vendor as you say. Thanks again. 

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 12, 2024

Hi!

Yes I now realize the JQL I provided will only take into account issues that have been created AND resolved in the same timespan.

So you might want to change it to an OR

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events