Skip to content

Instantly share code, notes, and snippets.

@xslim
Last active August 29, 2015 13:57
Show Gist options
  • Save xslim/9916734 to your computer and use it in GitHub Desktop.
Save xslim/9916734 to your computer and use it in GitHub Desktop.
Bump JIRA issues with Build number + put them in state 5

Install

  1. Install npm
  2. npm install -g git://github.com/xslim/jilla.git
  3. chmod +x jira_bump
  4. Run first jilla
$ jira_bump 
Can bump with status 731: EMTEL-1193, EMTEL-1334, EMTEL-1212, EMTEL-689, EMTEL-1195, EMTEL-1093
EMTEL-1193 <dinesh.rajpurohit> !! ios : Keyborad Next option not workign on ...
EMTEL-1334 <rslingerland>      !! Trx this week (points) does not match the ...
EMTEL-1212 <dinesh.rajpurohit> !! Same product is getting listed multiple ti...
EMTEL-689  <nanette.schoute>    ! App - messages - tweaks
EMTEL-1195 <dinesh.rajpurohit>  ! No message is getting displayed after clic...
EMTEL-1093 <rslingerland>       ! Text input should start with capital

Current Status : 3 In Progress
Statuses available :
731 Ready for test
791 Stop progress
811 Ready for review
851 Waiting for deployment to test environment

$ jira_bump 81
Bumping #81 on issues: EMTEL-1193, EMTEL-1334, EMTEL-1212, EMTEL-689, EMTEL-1195, EMTEL-1093
OK
#!/usr/bin/env node
// npm install -g git://github.com/xslim/jilla.git
// jira_bump - see running issues and what will be done
// Jira_bump 81 - bump with build 81
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { console.log(stdout) } //sys.puts
var issues = [];
exec('jilla ls running', function(err, out, stderr){
var lines = out.split("\n");
lines.forEach(function(line){
var s = line;
var n = s.indexOf(' ');
s = s.substring(0, n != -1 ? n : s.length);
s = s.trim();
if (s.length > 0) {
issues.push(s);
}
});
var new_status = 731;
var build = process.argv[2];
if (build == null) {
console.log('Can bump with status '+new_status+ ': ' + issues.join(', '));
console.log(out);
if (issues.length > 0) {
exec('jilla status '+issues[0], puts);
}
return;
}
console.log('Bumping #' + build + ' on issues: '+ issues.join(', '));
var comment = ' "Build #'+build+'"';
issues.forEach(function(item){
exec('jilla comment '+item + comment, puts);
exec('jilla status '+item + ' ' + new_status, puts);
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment