-
Notifications
You must be signed in to change notification settings - Fork 6
35 lines (33 loc) · 1.08 KB
/
qa_jira_ticket.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Create JIRA Ticket from GitHub Issue
on:
issues:
types: [labeled]
jobs:
create-jira-ticket:
runs-on: ubuntu-latest
if: contains(github.event.label.name, 'create-jira-ticket')
steps:
- name: Create JIRA Ticket
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT_KEY: ${{ secrets.JIRA_PROJECT_KEY }}
run: |
ISSUE_TITLE="${{ github.event.issue.title }}"
ISSUE_BODY="${{ github.event.issue.body }}"
curl -X POST -H "Content-Type: application/json" \
-u $JIRA_EMAIL:$JIRA_API_TOKEN \
--data '{
"fields": {
"project": {
"key": "'$JIRA_PROJECT_KEY'"
},
"summary": "'"$ISSUE_TITLE"'",
"description": "'"$ISSUE_BODY"'",
"issuetype": {
"name": "Task"
}
}
}' \
$JIRA_BASE_URL/rest/api/2/issue