Commit 43388234 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch...

Merge branch '39791-when-reopening-an-issue-the-mattermost-notification-has-no-context-to-the-issue' into 'master'

Resolve "When reopening an issue the Mattermost Notification has no context to the issue"

Closes #39791

See merge request gitlab-org/gitlab-ce!15218
parents 8138d58d 5e7d68ef
...@@ -39,7 +39,7 @@ module ChatMessage ...@@ -39,7 +39,7 @@ module ChatMessage
private private
def message def message
if state == 'opened' if opened_issue?
"[#{project_link}] Issue #{state} by #{user_combined_name}" "[#{project_link}] Issue #{state} by #{user_combined_name}"
else else
"[#{project_link}] Issue #{issue_link} #{state} by #{user_combined_name}" "[#{project_link}] Issue #{issue_link} #{state} by #{user_combined_name}"
......
---
title: Include link to issue in reopen message for Slack and Mattermost notifications
merge_request:
author:
type: fixed
...@@ -66,6 +66,19 @@ describe ChatMessage::IssueMessage do ...@@ -66,6 +66,19 @@ describe ChatMessage::IssueMessage do
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
end end
context 'reopen' do
before do
args[:object_attributes][:action] = 'reopen'
args[:object_attributes][:state] = 'opened'
end
it 'returns a message regarding reopening of issues' do
expect(subject.pretext)
.to eq('[<http://somewhere.com|project_name>] Issue <http://url.com|#100 Issue title> opened by Test User (test.user)')
expect(subject.attachments).to be_empty
end
end
end end
context 'with markdown' do context 'with markdown' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment