Skip to content

API doesn't return full information about slack service and doesn't update deployment channel (v11.11)

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

  1. API doesn't return full information about Slack notfications service. Response doesn't have deployment_events parameter.
  2. API doesn't update Deployment channel.

Steps to reproduce

Slack notifications settings

Request:

curl -s -X GET --header "PRIVATE-TOKEN: xxx" https://gitlab.instance.address/api/v4/projects/1/services/slack

Response:

{
   "active" : false,
   "updated_at" : "2019-05-22T22:16:54.774+03:00",
   "created_at" : "2016-05-04T12:01:00.614+03:00",
   "issues_events" : false,
   "merge_requests_events" : false,
   "tag_push_events" : false,
   "title" : "Slack notifications",
   "confidential_issues_events" : false,
   "push_events" : false,
   "properties" : {
      "confidential_issue_channel" : "",
      "notify_only_default_branch" : "0",
      "deployment_channel" : "",
      "webhook" : "",
      "note_channel" : "",
      "merge_request_channel" : "",
      "wiki_page_channel" : "",
      "tag_push_channel" : "",
      "confidential_note_channel" : "",
      "username" : "",
      "push_channel" : "",
      "notify_only_broken_pipelines" : "0",
      "pipeline_channel" : "",
      "issue_channel" : ""
   },
   "note_events" : false,
   "wiki_page_events" : false,
   "pipeline_events" : false,
   "id" : 610,
   "job_events" : false,
   "confidential_note_events" : false
}

Update slack notifications settings

Request:

curl -s -X PUT --header "PRIVATE-TOKEN: xxx" https://gitlab.instance.address/api/v4/projects/1/services/slack\?deployment_events\=true\&deployment_channel\=%23dep\&webhook\=https%3A%2F%2Fxxxxxxx

Response:

{
   "created_at" : "2016-05-04T12:01:00.614+03:00",
   "push_events" : false,
   "note_events" : false,
   "pipeline_events" : false,
   "title" : "Slack notifications",
   "tag_push_events" : false,
   "merge_requests_events" : false,
   "wiki_page_events" : false,
   "issues_events" : false,
   "confidential_note_events" : false,
   "id" : 610,
   "job_events" : false,
   "properties" : {
      "merge_request_channel" : "",
      "note_channel" : "",
      "wiki_page_channel" : "",
      "username" : "",
      "confidential_issue_channel" : "",
      "deployment_channel" : "",
      "confidential_note_channel" : "",
      "pipeline_channel" : "",
      "notify_only_default_branch" : "0",
      "issue_channel" : "",
      "push_channel" : "",
      "tag_push_channel" : "",
      "webhook" : "https://xxxxxxx",
      "notify_only_broken_pipelines" : "0"
   },
   "active" : true,
   "confidential_issues_events" : false,
   "updated_at" : "2019-05-22T22:27:05.017+03:00"
}
Edited by 🤖 GitLab Bot 🤖