{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/2","id":68377065,"html_url":"https://github.com/jenkinsci/mattermost-plugin/pull/2","diff_url":"https://github.com/jenkinsci/mattermost-plugin/pull/2.diff","patch_url":"https://github.com/jenkinsci/mattermost-plugin/pull/2.patch","issue_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/issues/2","number":2,"state":"open","locked":false,"title":"Don't include the channel in the request if the field is empty","user":{"login":"MaxCruz","id":10040334,"avatar_url":"https://avatars.githubusercontent.com/u/10040334?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxCruz","html_url":"https://github.com/MaxCruz","followers_url":"https://api.github.com/users/MaxCruz/followers","following_url":"https://api.github.com/users/MaxCruz/following{/other_user}","gists_url":"https://api.github.com/users/MaxCruz/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxCruz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxCruz/subscriptions","organizations_url":"https://api.github.com/users/MaxCruz/orgs","repos_url":"https://api.github.com/users/MaxCruz/repos","events_url":"https://api.github.com/users/MaxCruz/events{/privacy}","received_events_url":"https://api.github.com/users/MaxCruz/received_events","type":"User","site_admin":false},"body":"Hi. I made this little change to solve a problem that I had in my company by integrating  Mattermos with Jenkins. We want to make the request to the endpoint without specifying a channel, but if we let the field empty in the configuration, the channel is sent in the payload as \"channel\": \"\", and the request fails. I hope you find it useful, regards.","created_at":"2016-04-29T14:08:02Z","updated_at":"2016-04-29T14:08:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/2/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/2/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/issues/2/comments","statuses_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/statuses/17ec1b8150d53e961adc592646fc1875c96c55bc","head":{"label":"MaxCruz:master","ref":"master","sha":"17ec1b8150d53e961adc592646fc1875c96c55bc","user":{"login":"MaxCruz","id":10040334,"avatar_url":"https://avatars.githubusercontent.com/u/10040334?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxCruz","html_url":"https://github.com/MaxCruz","followers_url":"https://api.github.com/users/MaxCruz/followers","following_url":"https://api.github.com/users/MaxCruz/following{/other_user}","gists_url":"https://api.github.com/users/MaxCruz/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxCruz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxCruz/subscriptions","organizations_url":"https://api.github.com/users/MaxCruz/orgs","repos_url":"https://api.github.com/users/MaxCruz/repos","events_url":"https://api.github.com/users/MaxCruz/events{/privacy}","received_events_url":"https://api.github.com/users/MaxCruz/received_events","type":"User","site_admin":false},"repo":{"id":57309707,"name":"mattermost-plugin","full_name":"MaxCruz/mattermost-plugin","owner":{"login":"MaxCruz","id":10040334,"avatar_url":"https://avatars.githubusercontent.com/u/10040334?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxCruz","html_url":"https://github.com/MaxCruz","followers_url":"https://api.github.com/users/MaxCruz/followers","following_url":"https://api.github.com/users/MaxCruz/following{/other_user}","gists_url":"https://api.github.com/users/MaxCruz/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxCruz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxCruz/subscriptions","organizations_url":"https://api.github.com/users/MaxCruz/orgs","repos_url":"https://api.github.com/users/MaxCruz/repos","events_url":"https://api.github.com/users/MaxCruz/events{/privacy}","received_events_url":"https://api.github.com/users/MaxCruz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaxCruz/mattermost-plugin","description":"Jenkins plugin for Mattermost","fork":true,"url":"https://api.github.com/repos/MaxCruz/mattermost-plugin","forks_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/forks","keys_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/teams","hooks_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/hooks","issue_events_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/events","assignees_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/tags","blobs_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/languages","stargazers_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/stargazers","contributors_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/contributors","subscribers_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/subscribers","subscription_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/subscription","commits_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/merges","archive_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/downloads","issues_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/labels{/name}","releases_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/MaxCruz/mattermost-plugin/deployments","created_at":"2016-04-28T14:49:52Z","updated_at":"2016-04-28T14:49:53Z","pushed_at":"2016-04-29T13:43:44Z","git_url":"git://github.com/MaxCruz/mattermost-plugin.git","ssh_url":"git@github.com:MaxCruz/mattermost-plugin.git","clone_url":"https://github.com/MaxCruz/mattermost-plugin.git","svn_url":"https://github.com/MaxCruz/mattermost-plugin","homepage":null,"size":189,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"108f394f704749529a45869b789e548d9314fb18","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":45607561,"name":"mattermost-plugin","full_name":"jenkinsci/mattermost-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/mattermost-plugin","description":"Jenkins plugin for Mattermost","fork":true,"url":"https://api.github.com/repos/jenkinsci/mattermost-plugin","forks_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/mattermost-plugin/deployments","created_at":"2015-11-05T11:37:34Z","updated_at":"2016-04-11T15:42:13Z","pushed_at":"2016-04-29T14:08:02Z","git_url":"git://github.com/jenkinsci/mattermost-plugin.git","ssh_url":"git@github.com:jenkinsci/mattermost-plugin.git","clone_url":"https://github.com/jenkinsci/mattermost-plugin.git","svn_url":"https://github.com/jenkinsci/mattermost-plugin","homepage":null,"size":191,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/2"},"html":{"href":"https://github.com/jenkinsci/mattermost-plugin/pull/2"},"issue":{"href":"https://api.github.com/repos/jenkinsci/mattermost-plugin/issues/2"},"comments":{"href":"https://api.github.com/repos/jenkinsci/mattermost-plugin/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/mattermost-plugin/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/mattermost-plugin/statuses/17ec1b8150d53e961adc592646fc1875c96c55bc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}