yetibot / yetibot

🤖 Extreme chatops bot for Slack, Discord, Mattermost, IRC 🔧 New contributors welcome 🏗

Home Page:https://yetibot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More general way to parameterize commands from the context of a channel

devth opened this issue · comments

Today we can set a small set of settings in a channel, like:

!channel set jira-project YETIBOT

Support for this is baked in directly to the jira command though, so it's very specialized. Parameters for some commands, especially those with many options like jira are very team-specific. And the context for a team is the channel. For example we could set default component, fix version, assignee, etc for all issues created in a specific channel just by configuring the channel settings. They can change too: e.g. each week someone could update the channel setting for fix version to tie it to the current sprint.

To make it general we could come up with a convention. Using jira as the example:

jira create <summary> [options] # creates a new JIRA issue.
Whether options are optional or not depend on your JIRA Project
configuration. For example, sometimes description is required.
Options are:
-j, --project-key PROJECT KEY
Project key (use channel set jira-project PROJECT1 to set a channel-specific default)
-c, --component COMPONENT
Component
-i, --issue-type ISSUE TYPE
Issue type
-s, --summary SUMMARY
Summary
-a, --assignee ASSIGNEE
Assignee
-e, --reporter REPORTER
Reporter
-f, --fix-version FIX VERSION
Fix version
-d, --desc DESCRIPTION
Description
-t, --time TIME ESTIAMTED
Time estimated
-r, --remaining REMAINING TIME ESTIAMTED
Remaining time estimated
-p, --parent PARENT ISSUE KEY
Parent issue key; creates a sub-task if specified
-y, --priority PRIORITY
Priority of the issue

We could set channel defaults using a convention like:

!channel set jira:project-key FOO
!channel set jira:component Frontend

Could maybe even parameterize it on a subcomand basis:

!channel set jira:update:priority P2