Creating a custom time-series (burndown) chart using JavaScript Chart for JIRA Cloud

William Frenick January 28, 2020

Hello,

I am running into difficulty getting a line chart that plots two series:

issues created since the startofyear (increasing over time)

issues created this year are closed or moved to a specific status (decreasing over time)

Creating a filter that returns a list of these tickets is simple. However, trying to get these to plot over time using the JavaScript Chart for JIRA Cloud gadget introduces complications to the JQL as it wants to insert "DURING" to most of the aspects of the query.

Basically, my filter is:

Project = X And created >= startofyear() - This would be the first series to track the total count of newly created tickets this year.

Project = X AND created >=startofyear() AND status CHANGED TO 'Done' - THis would be series 2 to track the closure of items created this year.

In the Javascript Chart using "TIme Series Field"= None (sum of existing issues) allows me to enter JQL. It is this JQL that is causing me grief. It will not allow me to use the "CreatedDate >= startofyear()" syntax in the JQL though this works as a normal search filter.

Any ideas? There must be a way without going to a 3rd party gadget

 

ADDITIONAL INFO

I can successfully get the number of issues created each day starting 1/1/2020 through current day by selecting the "Created" Time Series Field from the Datasets tab within the JavaScript Chart for JIRA configuration screens. However, when I switch the Time Series Field to "None (sum of existing issues) using the exact same query, I would expect to see a running sum starting with 1/1/2020 through the current day. But when I make that one switch, I then see issues displaying from prior to 1/1/2020. Here is the JQL I'm using:

 

Project in (LIST OF PROJECTS) AND status was in (New) after 2020-01-01 AND status was not in (New, "Dev Ready", "In Grooming", "On Hold", "In Development", Cancelled, "Dev Complete", "Ready for USGA Approval", Done) before 2020-01-01

I'm using this convoluted method of getting the date range I want because the JQL editor rejects the use of the createdDate field in combination with the "None" Time Series Field setting.

1 answer

2 votes
William Frenick January 28, 2020

Gotta love when you get to post your own answer!

Doing more research I came across the following post:

https://bitbucket.org/dboyd-atl/javascript-charts-for-jira-cloud/issues/61/suggest-using-a-variable-for-time-series

This gave me the info needed to solve this. When you select "None" in the Time Series Field, the JQL editor inserts the necessary DURING statements (or so you'd think) to make your query work propery, but that is not the case. The DURING, by default, is only applied at the end of your query (as mentioned in that link). A fix was put in by Atlassian that allows you to insert placeholders for where the DURING statements should go, so you can put one after each condition in your query.

My query previously was:

Project in (PROJECT LIST) AND status was in (New) after 2020-01-01 AND status was not in (New, "Dev Ready", "In Grooming", "On Hold", "In Development", Cancelled, "Dev Complete", "Ready for USGA Approval", Done) before 2020-01-01

Leaving the JQL Editor to it's own devices, it will add (invisibly) a DURING statement only to the last condition in my query (after the final "before 2020-01-01").

Now that you can put placeholders $DURING in to force the JQL Editor, I was able to correct it as follows:

Project in (PROJECT LIST) AND status was in (New) after 2020-01-01 $DURING AND status was not in (New, "Dev Ready", "In Grooming", "On Hold", "In Development", Cancelled, "Dev Complete", "Ready for USGA Approval", Done) before 2020-01-01 $DURING

Hope this helps someone that hits a similar issue (like me) and isn't a developer (also like me).

Suggest an answer

Log in or Sign up to answer