summaryrefslogtreecommitdiff
path: root/lib/gitlab/chat_commands/issue_search.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2016-11-25 15:41:28 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2016-11-25 15:41:28 +0100
commit6a08de7386fd41c9bbe27c32338328c6e6b40027 (patch)
tree52fe3a09f03d34b79507edf4d46d5fca0abaa2fe /lib/gitlab/chat_commands/issue_search.rb
parent2914fa3919a4d8fa12758d66793478a485ad5335 (diff)
downloadgitlab-ce-6a08de7386fd41c9bbe27c32338328c6e6b40027.tar.gz
Add issue search slash commandzj-issue-search-slash-command
One of many requested in: gitlab-org/gitlab-ce#24768
Diffstat (limited to 'lib/gitlab/chat_commands/issue_search.rb')
-rw-r--r--lib/gitlab/chat_commands/issue_search.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/chat_commands/issue_search.rb b/lib/gitlab/chat_commands/issue_search.rb
new file mode 100644
index 00000000000..51bf80c800b
--- /dev/null
+++ b/lib/gitlab/chat_commands/issue_search.rb
@@ -0,0 +1,17 @@
+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