Permalink
Browse files

Merge pull request #6 from angrycub/zendesklinker

Added zendesklinking script
  • Loading branch information...
2 parents c1a40fc + 050464b commit 95189e01ea2fadc4b6756ed585eff0342ca00ed6 @angrycub angrycub committed Mar 11, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 scripts/zendesklinker.coffee
@@ -0,0 +1,11 @@
+# ZenDesk Linker
+#
+# Attempts to naively build a link to a zendesk ticket whenever the
+# word ticket or request is followed with a # and a number.
+#
+#
+
+module.exports = (robot) ->
+ robot.hear /(ticket|response|review)[^#]*?#\s*(\d+)/i, (msg)->
+ ticketNum = escape(msg.match[2])
+ msg.send "https://basho.zendesk.com/agent/#/tickets/"+ticketNum

0 comments on commit 95189e0

Please sign in to comment.