Unable to set channel name or user when enabling Mattermost notification commands
Summary
When you call the /api/v3/project/:id/services/mattermost and PUT the webhook, username, and channel only the webhook is accepted.
Steps to reproduce
- call /api/v3/project/:id/services/mattermost and PUT a webhook, username, and channel.
- Navigate to https://example.com/group/project/services/mattermost/edit
- Note the default "town-square" is present in all fields.
What is the current bug behavior?
The default value of "town-square" is present within each input field.
What is the expected correct behavior?
The value in which you pass in as part of the api PUT should be present within the fields.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
I do not have access to the server to execute this.
Results of GitLab application Check
I do not have access to the server to execute this.
Possible fixes
Need to update the services.rb file at L503 to the below config so it matches slack. Currently the only expected input for mattermost is the webhook.
{
required: false,
name: :new_issue_url,
type: String,
desc: 'The user name'
},
{
required: false,
name: :channel,
type: String,
desc: 'The channel name'
}