mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-15 23:30:46 +00:00
Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
@ -33,6 +33,8 @@ module Gitlab
|
||||
record: create_note,
|
||||
invalid_exception: InvalidNoteError,
|
||||
record_name: 'comment')
|
||||
|
||||
reopen_issue_on_external_participant_note
|
||||
end
|
||||
|
||||
def metrics_event
|
||||
@ -71,6 +73,34 @@ module Gitlab
|
||||
|
||||
raise UserNotFoundError unless from_address && author.verified_email?(from_address)
|
||||
end
|
||||
|
||||
def reopen_issue_on_external_participant_note
|
||||
return unless noteable.closed?
|
||||
return unless author == Users::Internal.support_bot
|
||||
return unless project.service_desk_setting&.reopen_issue_on_external_participant_note?
|
||||
|
||||
::Notes::CreateService.new(
|
||||
project,
|
||||
Users::Internal.support_bot,
|
||||
noteable: noteable,
|
||||
note: build_reopen_message,
|
||||
confidential: true
|
||||
).execute
|
||||
end
|
||||
|
||||
def build_reopen_message
|
||||
translated_text = s_(
|
||||
"ServiceDesk|This issue has been reopened because it received a new comment from an external participant."
|
||||
)
|
||||
|
||||
"#{assignees_references} :wave: #{translated_text}\n/reopen".lstrip
|
||||
end
|
||||
|
||||
def assignees_references
|
||||
return unless noteable.assignees.any?
|
||||
|
||||
noteable.assignees.map(&:to_reference).join(' ')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user