Created
May 27, 2012 21:53
-
-
Save alyx/2816041 to your computer and use it in GitHub Desktop.
JIRA issue information thing
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
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