Search code examples
gitlabgitlab-cislack

Customize GitLab slack integration messages


Is it possible to change the automatic slack notifications on "Receive event notifications in Slack"?

For example, if a pipeline has successfully completed, we get the following message from the Webhook:

User/Project Name: Pipeline #269 of tag Ticket_8088 by User-Name (User) passed in 12:02

The form of the message should be different.

I am the server administrator. So I can also change something at the code level. (if required)


Solution

  • There isn't a programmatic way to accomplish such task.

    All messages are hardcoded in app/models/project_services/chat_message (as you can see in the repo).

    So, in your case, you need to change the method activity in app/models/project_services/chat_message/pipeline_message.rb - please consider that your changes will be discarded when you update GitLab.