diff --git a/src/yetibot/api/jira.clj b/src/yetibot/api/jira.clj index c6f5ed7c..6b7d6cde 100644 --- a/src/yetibot/api/jira.clj +++ b/src/yetibot/api/jira.clj @@ -40,7 +40,8 @@ "Retrieve the list of configured projects for a channel, given its settings" [channel-settings] (when-let [setting (channel-settings jira-project-setting-key)] - (s/split setting #",\s*"))) + (info "channel-projects" (pr-str setting)) + (seq (remove s/blank? (s/split setting #",\s*"))))) (defn config [] (:value (get-config jira-schema [:jira]))) diff --git a/src/yetibot/commands/jira.clj b/src/yetibot/commands/jira.clj index c946a697..e4ab83e5 100644 --- a/src/yetibot/commands/jira.clj +++ b/src/yetibot/commands/jira.clj @@ -233,11 +233,16 @@ {:yb/cat #{:issue}} [{:keys [settings]}] (binding [api/*jira-projects* (channel-projects settings)] - (report-if-error - #(api/recent) - (fn [res] - {:result/value (short-jira-list res) - :result/data (-> res :body :issues)})))) + (info "recent" (pr-str api/*jira-projects*)) + (if api/*jira-projects* + (report-if-error + #(api/recent) + (fn [res] + {:result/value (short-jira-list res) + :result/data (-> res :body :issues)})) + {:result/error + "You don't have any JIRA projects configured for this channel. Use `channel set jira-project PROJECT1,PROJECT2` to configure 1 or more." + }))) (defn search-cmd "jira search # return up to 15 issues matching across all configured projects"