gitlab-org--gitlab-foss/lib/gitlab/chat_commands/issue_search.rb
Z.J. van de Weg 6a08de7386 Add issue search slash command
One of many requested in: gitlab-org/gitlab-ce#24768
2016-11-25 15:41:28 +01:00

17 lines
353 B
Ruby

module Gitlab
module ChatCommands
class IssueSearch < IssueCommand
def self.match(text)
/\Aissue\s+search\s+(?<query>.*)/.match(text)
end
def self.help_message
"issue search <your query>"
end
def execute(match)
collection.search(match[:query]).limit(QUERY_LIMIT)
end
end
end
end