Skip to content
Browse files

Merge pull request #655 from maestrodev/issue-matching

Better issue matching
  • Loading branch information...
2 parents 71bedb9 + 5693ee2 commit faa1e34f286c4cfd1905333a5ce8662322aff562 Tom Bell committed Jan 10, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/scripts/jira-issues.coffee
View
6 src/scripts/jira-issues.coffee
@@ -6,6 +6,7 @@
#
# Configuration:
# HUBOT_JIRA_DOMAIN
+# HUBOT_JIRA_IGNORECASE (optional; default is "true")
#
# Commands:
#
@@ -26,7 +27,10 @@ module.exports = (robot) ->
json = JSON.parse(data)
jiraPrefixes = ( entry.key for entry in json )
reducedPrefixes = jiraPrefixes.reduce (x,y) -> x + "-|" + y
- jiraPattern = "/(" + reducedPrefixes + "-)(\\d+)/gi"
+ jiraPattern = "/\\b(" + reducedPrefixes + "-)(\\d+)\\b/g"
+ ic = process.env.HUBOT_JIRA_IGNORECASE
+ if ic == undefined || ic == "true"
+ jiraPattern += "i"
robot.hear eval(jiraPattern), (msg) ->
for i in msg.match

0 comments on commit faa1e34

Please sign in to comment.
Something went wrong with that request. Please try again.