Using channel defaults
When you create an issue, it often happens that you need to create it with similar parameter and field values that you did before. For instance, you might want to assign it to the same person, always put Lowest as a priority or set a “jirio” component for all issues that you create from Slack.
If this is the case, you can (and should) leverage channel defaults. This feature allows to set default values for any fields that will be always sent with the “create” command unless you override them.
Set channel defaults
/jirio set [:token] value
Sets default value for token
:token for current Slack channel that will be always sent to JIRA when creating new issue with
/jirio create command. The list of supported tokens could be obtained when running the
/jirio reload command. It is possible though to override channel default value by supplying this token value with
/jirio create command itself. The following example sets project key to JRS for current channel:
/jirio set :project JRS
In order to see what fields have defaults in current channel, just type a set command without any tokens like this:
and it will print all fields and their values that have defaults in the current channel.
Setting default issue key
You can set issue key per channel so that whenever you invoke a command such as update, vote, comment or others without specifying an issue key, it will default to the previously set channel default issue key.
Consider the following scenario: you create a new channel per JIRA ticket and whatever goes to this channel always relates to the one specific JIRA ticket. Once the issue is solved, the channel is closed.
In this particular case it might make sense to “save” the JIRA ticket right when the channel is created. This can be achieved by running the following set command:
/jirio set :issuekey TSK-1
TSK-1 is your JIRA ticket key. Once this is done, you can try other issue specific commands like this.
/jirio vote issuekey
This will vote for the
TSK-1 issue. The trick is that you have to use the reserved word “issuekey” whenever you want to refer to the “saved” channel default issue key. Here are some other examples:
/jirio comment issuekey This is my comment
will actually be replaced as
/jirio comment TSK-1 This is my comment
/jirio update issuekey :priority Low
/jirio update TSK-1 :priority Low
/jirio transit issuekey in progress
/jirio transit TSK-1 in progress
Unset channel defaults
/jirio unset [:token]
Removes default value for token
:token for current Slack channel that was previously set with
/jirio set command. The following example removes project key for current channel from defaults:
/jirio unset :project
For example, you always want to create JIRA issues with the lowest priority. In this case you have to run the following command:
/jirio set :priority Lowest
then, when you create an issue like this:
/jirio create bug This is a nasty bug
you will notice that the bug you have just created will have the lowest priority assigned.