diff options
Diffstat (limited to 'lib/gitlab/quick_actions')
-rw-r--r-- | lib/gitlab/quick_actions/issue_actions.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/gitlab/quick_actions/issue_actions.rb b/lib/gitlab/quick_actions/issue_actions.rb index 14e9e66e037..f782f2802b6 100644 --- a/lib/gitlab/quick_actions/issue_actions.rb +++ b/lib/gitlab/quick_actions/issue_actions.rb @@ -252,23 +252,14 @@ module Gitlab desc { _('Promote issue to incident') } explanation { _('Promotes issue to incident') } + execution_message { _('Issue has been promoted to incident') } types Issue condition do - quick_action_target.persisted? && - !quick_action_target.incident? && - current_user.can?(:update_issue, quick_action_target) + !quick_action_target.incident? && + current_user.can?(:"set_#{quick_action_target.issue_type}_metadata", quick_action_target) end command :promote_to_incident do - issue = ::Issues::UpdateService - .new(project: quick_action_target.project, current_user: current_user, params: { issue_type: 'incident' }) - .execute(quick_action_target) - - @execution_message[:promote_to_incident] = - if issue.incident? - _('Issue has been promoted to incident') - else - _('Failed to promote issue to incident') - end + @updates[:issue_type] = "incident" end desc { _('Add customer relation contacts') } |