gitlab-org--gitlab-foss/lib/gitlab/chat_commands/issue_show.rb
Z.J. van de Weg d71ad49fc5 Accept a valid ref for issue show
For example, now we support `/gitlab issue show #1`. Where the # used
to trip the regex.
2016-11-25 12:33:57 +01:00

17 lines
337 B
Ruby

module Gitlab
module ChatCommands
class IssueShow < IssueCommand
def self.match(text)
/\Aissue\s+show\s+#{Issue.reference_prefix}?(?<iid>\d+)/.match(text)
end
def self.help_message
"issue show <id>"
end
def execute(match)
find_by_iid(match[:iid])
end
end
end
end