Skip to content

Commit a372a2f

Browse files
committed
[Stewart] Let users write a simple description when making a ticket with hal
1 parent 5d90365 commit a372a2f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/jira.coffee

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# HUBOT_JIRA_URL (format: "https://jira-domain.com:9090")
1010
# HUBOT_JIRA_USERNAME
1111
# HUBOT_JIRA_PASSWORD
12-
# HUBOT_JIRA_PROJECTS_MAP (format: {\"web\":\"WEB\",\"android\":\"AN\",\"ios\":\"IOS\",\"platform\":\"PLAT\"}
12+
# HUBOT_JIRA_PROJECTS_MAP (format: "{\"web\":\"WEB\",\"android\":\"AN\",\"ios\":\"IOS\",\"platform\":\"PLAT\"}"
1313
#
1414
# Commands:
1515
# hubot bug - File a bug in JIRA corresponding to the project of the channel
@@ -42,13 +42,16 @@ module.exports = (robot) ->
4242
user = JSON.parse body
4343
reporter = user[0] if user and user.length is 1
4444
finally
45+
desc = msg.match(/"(.*?)"/)[1] if /"(.*?)"/.test(msg)
46+
msg = msg.replace(/"(.*?)"/,"") if desc != undefined
4547
issue =
4648
fields:
4749
project:
4850
key: project
4951
summary: msg.match[1]
5052
labels: ["triage"]
51-
description: """
53+
description: (if desc != undefined then (desc + "\n") else "") +
54+
"""
5255
Reported by #{msg.message.user.name} in ##{msg.message.room} on #{robot.adapterName}
5356
https://#{robot.adapter.client.team.domain}.slack.com/archives/#{msg.message.room}/p#{msg.message.id.replace '.', ''}
5457
"""

0 commit comments

Comments
 (0)