hubot-iteration-script
Version:
A hubot script that gives useful information about Agile iterations.
62 lines (51 loc) • 2.15 kB
JavaScript
;
var _metric = require('./metrics/metric');
var _metric2 = _interopRequireDefault(_metric);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var allowedRooms = process.env.ALLOWED_ITERATION_ROOMS.split(','); // Description:
// Need to know what this iteration's commitment is?
// Hubot will tell to what the iteration commitment is.
//
// Need to know where the team stands on their commitment?
// Hubot will tell you what the team needs in order to hit their commitment.
//
// Configuration:
// None
//
// Commands:
// hubot what is our commitment? - Reports what the current status is for Dev Complete and Accepted bugs/story points
// hubot commitment - Reports what the current status is for Dev Complete and Accepted bugs/story points
//
// Author: Camden Brown
module.exports = function (robot) {
robot.respond(/dev complete story points: (.*)/i, function (_ref) {
var match = _ref.match,
room = _ref.message.room;
if (allowedRooms.some(function (i) {
return room == i;
})) {
robot.brain.set('devCompleteStoryPointCommitment', match[1]);
}
});
robot.respond(/dev complete bugs: (.*)/i, function (_ref2) {
var match = _ref2.match,
room = _ref2.message.room;
if (allowedRooms.some(function (i) {
return room == i;
})) {
robot.brain.set('devCompleteBugCommitment', match[1]);
}
});
robot.respond(/commitment/i, function (_ref3) {
var match = _ref3.match,
room = _ref3.message.room,
reply = _ref3.reply;
if (allowedRooms.some(function (i) {
return room == i;
})) {
var devCompleteStoryPointCommitment = robot.brain.get('devCompleteStoryPointCommitment');
var devCompleteBugCommitment = robot.brain.get('devCompleteBugCommitment');
reply('Your team currently has:\n ' + _metric2.default.getDevCompleteStoryPoints() + ' out of ' + devCompleteStoryPointCommitment + ' story points in Dev Complete\n ' + _metric2.default.getDevCompleteBugs() + ' out of ' + devCompleteBugCommitment + ' bugs in Dev Complete');
}
});
};