Skip to content

Instantly share code, notes, and snippets.

@alyx
Created May 27, 2012 21:53
Show Gist options
  • Save alyx/2816041 to your computer and use it in GitHub Desktop.
Save alyx/2816041 to your computer and use it in GitHub Desktop.
JIRA issue information thing
var irc = require('irc'),
JiraApi = require('jira').JiraApi;
var user = 'user',
pass = 'pass',
ircuser = 'user',
ircpass = 'pass';
var jira = new JiraApi('http', 'jira.arinity.org', 80, user, pass, 'latest');
var client = new irc.Client('irc.staticbox.net', 'issues', { userName: 'issues', realName: 'Sigyn Issue Monitor', port: 6667, channels: ['#sigyn']});
client.addListener('registered', function(message) { client.say('NickServ', 'IDENTIFY ' + ircuser + ' ' + ircpass); });
client.addListener('message#sigyn', function(from, message) {
if (words[0] == "#issue")
{
jira.findIssue(words[1], function(error, issue) {
if (error != null)
{
client.say('#sigyn', "Error: " + error);
return;
}
console.log(inspect(issue));
client.say('#sigyn', "Issue " + issue.key + ' [' + issue.fields.issuetype.name +']: ' + issue.fields.summary +
' [Status: ' + issue.fields.status.name + ', reported by: ' + issue.fields.reporter.name + ']');
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment