Let's say it will be in path d:/Git/
Press CTRL + R
and run d:/Git/bin/git.exe
.
$ git clone https://github.com/onepica/slack-jira-notifier /d/slack-jira-notifier
And enter into project directory
$ cd /d/slack-jira-notifier
JIRA Credentials
Create file params-base.sh
in any editor with content:
#!/usr/bin/env bash
# base connection parameters
JIRA_URL='https://jira.example.com/'
JIRA_USERNAME='u.sername'
JIRA_PASSWORD='secret123'
APP_MESSAGE_USER='John Doe'
APP_SLACK_WEBHOOK='https://hooks.slack.com/services/ZZZZZZ/XXXXXX/YYYYYYYYYYYYYYYY'
Project set up
Create file params-base-EXAMPLE.sh
(where EXAMPLE
is your real project target JIRA key)
in any editor with content:
#!/usr/bin/env bash
# Slack channel for posting messages
APP_SLACK_CHANNEL='#EXAMPLE-gen'
# JIRA project key
APP_JIRA_PROJECT='EXAMPLE'
# Add users for default mentioning. Either @username or @here or @channel
# See: https://get.slack.help/hc/en-us/articles/202009646-Make-an-announcement
#APP_MESSAGE_CC='//cc @here'
So, just run:
$ bin/slack-jira-task EXAMPLE-123
You may post a message with additional comment (@channel
will mention all people in a channel):
$ bin/slack-jira-task EXAMPLE-123 'Hey team, we got to *REOPEN* this issue. :wink:\n//cc @hannah_rest'
- First line is a main text.
- Grey line with user names are
Reporter Name -> Assignee Name
. - Link title use your posted JIRA issue key, and generates according to predefined format.
- Sprint taken from the issue data path
fields/customfield_10600/
(it uses regular expression to get a sprint name/name=([^,]+)/
).
And type taken by pathfields/issuetype/name
See more in the fileread-task.php
. - "Posted by" line use your predefined custom name.