Created
May 19, 2014 16:15
-
-
Save afternoon/6012b8ba1292810b40ad to your computer and use it in GitHub Desktop.
Show a report of progress on Jira epics from a rapid board
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var request = require('request-promise'), | |
Table = require('cli-table'); | |
var jiraUrl = 'http://jira.yourcompany.com', // change this | |
rapidViewId = 1, // get this from the rapid board URL | |
url = jiraUrl + '/rest/greenhopper/1.0/xboard/plan/backlog/epics?rapidViewId=' + rapidViewId, | |
interestingEpics = []; // add epic IDs to restrict what's included | |
var progressBar = function (percentageCompleted) { | |
var numBars = Math.floor((percentageCompleted || 0) / 10), | |
numSpaces = 10 - numBars; | |
return '[' + Array(numBars + 1).join('=') + Array(numSpaces + 1).join(' ') + ']'; | |
}; | |
request({url: url, json: true}).then(function (data) { | |
var table = new Table({head: ['Epic', 'Summary', 'Complete', '']}); | |
data.epics.filter(function (epic) { | |
return interestingEpics.length === 0 || | |
interestingEpics.indexOf(epic.id) !== -1; | |
}).forEach(function (epic) { | |
table.push([ | |
epic.id, | |
epic.summary, | |
epic.epicStats.percentageCompleted + '%', | |
progressBar(epic.epicStats.percentageCompleted) | |
]); | |
}); | |
console.log(table.toString()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment