Get burndown chart information through API for add-on

Matthew Brand March 28, 2018

I'm trying to write an add-on that utilizes the information available on the burndown chart. Through extensive googling (because there's no docs on these endpoints), I was able to find this REST endpoint that returns the data I want 

/rest/greenhopper/1.0/rapid/charts/scopechangeburndownchart?rapidViewId=1234&sprintId=5678

That works through manual testing in Postman, however, when I try to test it in my add-on I get  an error saying

Failed to validate origin

I can connect to the standard JIRA REST API just fine, so I'm guessing there's an issue with hitting the greenhopper API.

Is there a "standard" JIRA REST endpoint that has this data (I can't find one in the documentation) or is there a way to allow my add-on to hit that endpoint?

1 answer

2 votes
Martin van Vliet October 14, 2018

Hi Matthew,

I'm facing the same problem. Have tried accessing this API via (3LO) OAuth code grants as well as the JWT authentication. Neither options allow me to access the greenhopper API. The only way I've been able to do this is using basic authentication. :-( 

I'd love to hear it if you've found another way!

Regards, Martin

David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2019

Were you able to finally test the connection for the burndown? I was trying to use postman with basic authentication with other authentication option I am getting the same result. I am getting this:

 

{
"errorMessages": [],
"errors": {
"rapidViewId": "The requested board cannot be viewed because it either does not exist or you do not have permission to view it."
}
}

Best Regards,

 

David

Martin van Vliet February 21, 2019

Hi David,

I was never able to access the Greenhopper APIs. Instead, I constructed my own burndown based on the tickets in the sprint and their changelog. A lot of work to be frank, but it did allow my project https://sprintlr.io/ to create burndown graphs for JIRA instances that I can access via OAuth.

Martin

David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2019

@Martin van Vliet I was able to make run the query directly from the browser having an open session from my Jira project on another tab:

https://xxxxxx.atlassian.net/rest/greenhopper/1.0/rapid/charts/scopechangeburndownchart?rapidViewId=305&sprintId=1185

For my sprint with ID 1185.

There is a suggestion here for JSWSERVER-12877. about to document it since 2015! it has more than 28 votes, it seems they need more, :-)


The output is not friendly I don't know how to parse it. I need the initial situation once the sprint started:

Capture.JPG

inside <changes> node we have a list of elements that has been changed in a format like this one:

"changes": {
    "1536581836000": [
    {
         "key": "ATHP-789",
         "statC": {
         "newValue": 3.0
    },
    "column": {
         "notDone": true,
         "newStatus": "10037"
    }
}
],

but the elements inside could change, I have seen: added, done, newstatus, etc. The value "1536581836000" represents a time in a numeric format. I guess when the changes occurred.

The <issueToSummary> node has an information that it is easy to parse:

"issueToSummary": {
XYZ-3119 : "summary 1"
XYZ-3911 : "summary 2"
XYZ-1252 : "summary 3"
...
}

it corresponds with the final list of the issues at the end of the Sprint from the burndown diagram. 

But, I need a list of the issue keys at the beginning of the Sprint and that information is more difficult to obtain. I need to parse all <changes> nodes and to do a kind of reverse engineering to understand the meaning of the values.

David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 23, 2019

I was able to get all the issues at the beginning of the Sprint parsing the JSON string. Here: 

JQL on a given date does not return the same number of issues as in the Burn-up chart (Sprint start)

I documented how I was able to do it, in case it helps.

Suggest an answer

Log in or Sign up to answer