suer / redmine_webhook

147 stars 81 forks source link

add 'assignee' to data #2

Closed tenten0213 closed 9 years ago

tenten0213 commented 9 years ago

becomes able to get the 'Assignee' data after merge this PR.

suer commented 9 years ago

It is nice idea!

It seams that Redmine will crash if @issue.assigned_to is nil. I would like you to add a sentence to check nil at RedmineWebhook::AuthorWrapper#to_hash. It should return {} if its @author is nil.

For example, as follows:

  def to_hash
    return nil unless @author
    ...
tenten0213 commented 9 years ago

It seams that Redmine will crash if @issue.assigned_to is nil. I would like you to add a sentence to check nil at RedmineWebhook::AuthorWrapper#to_hash. It should return {} if its @author is nil.

寿司ゆき:sorry

I fixed it. It return "assignee": null if not set assignee.

{
  "payload": {
    "issue": {
      "author": {
        ...
      },
      "assignee": null,
 ...
suer commented 9 years ago

LGTM. returning nil is right. Thanks a lot.

tenten0213 commented 9 years ago

寿司ゆき:thanks