Skip to content

Commit

Permalink
[jira] fix get username return empty string; Send messeage to correct…
Browse files Browse the repository at this point in the history
… channel.
  • Loading branch information
ngdinhtoan committed Jun 23, 2015
1 parent 26cb40f commit 30caed1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion jira/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func getMarkdownUsername(user *jc.User) string {
}

var name string
if name := user.DisplayName; name == "" {
if name = user.DisplayName; name == "" {
name = user.Name
}

Expand Down
8 changes: 2 additions & 6 deletions jira/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ func (t *ticket) Execute(payload *slackcmd.Payload, w http.ResponseWriter) error

whPayload := webhook.NewPayload()
whPayload.Text = fmt.Sprintf("`%s %s`", payload.Command, payload.Text)
if payload.IsPrivateGroup() == false {
whPayload.Channel = "#" + payload.ChannelName
} else {
//todo: get channel name by channel ID via Slack API!?
}
whPayload.Channel = payload.ChannelID

wg := &sync.WaitGroup{}
lk := &sync.Mutex{}
Expand Down Expand Up @@ -79,7 +75,7 @@ func (t *ticket) Execute(payload *slackcmd.Payload, w http.ResponseWriter) error

wg.Wait()

webhook.SendMessage(whPayload)
go webhook.SendMessage(whPayload)

var err error
if len(notFoundIssues) > 0 {
Expand Down

0 comments on commit 30caed1

Please sign in to comment.