Get useful information about a JIRA board using the REST API -
i've been digging around documentation jira's latest rest api (6.0.1) try , dig out information particular dashboard (i'm playing around dashing create widget displaying number of open issues in particular sprint). according this:
https://developer.atlassian.com/static/rest/jira/6.0.1.html
jira.com/rest/api/2/dashboard/11311 give me like:
{ "id": "11311", "name": "blah", "self": "jira.com\/rest\/api\/2\/dashboard\/11311", "view": "jira.com\/secure\/dashboard.jspa?selectpageid=11311" }
which doesn't give me lot of information.
in greenhopper times, more useful information like:
/rest/greenhopper/1.0/xboard/work/alldata.json?rapidviewid=#{board_id}"
(taken here) seems not work now..any ideas if there's endpoint might return more information?
i managed via jql query. '914' agile board id (a neat way find checking last digits of 'report' url of board)
scheduler.every '5s', :first_in => 0 |job| uri = uri.parse(jira_url) http = net::http.new(uri.host, uri.port) req = net::http::get.new("/rest/api/2/search?jql=sprint%20%3d%20914%20and%20status%20%3d%20%27in%20progress%27") req.basic_auth username, password response = http.request(req) issuesinprogress = json.parse(response.body)["total"] send_event('buzzwords', value: issuesinprogress) end
this useful tool encode query urlencode.
sprint = 914 , status = 'in progress' encodes sprint%20%3d%20914%20and%20status%20%3d%20%27in%20progress%27
Comments
Post a Comment