-
Notifications
You must be signed in to change notification settings - Fork 4
39 lines (35 loc) · 1.15 KB
/
jira-integration.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
36
37
38
39
name: Create Jira Ticket on Issue Creation
on:
issues:
types: [opened]
jobs:
create-jira-ticket:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create Jira Ticket
env:
JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }}
JIRA_EMAIL: ${{ vars.JIRA_EMAIL }}
JIRA_API_TOKEN: ${{ vars.JIRA_API_TOKEN }}
JIRA_PROJECT_KEY: ${{ vars.JIRA_PROJECT_KEY }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
curl -X POST -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"project": {
"key": "'"$JIRA_PROJECT_KEY"'"
},
"summary": "'"$ISSUE_TITLE"'",
"description": "'"$ISSUE_BODY"'",
"issuetype": {
"name": "Task"
}
}
}' \
"$JIRA_BASE_URL/rest/api/2/issue/"