Skip to content

Commit

Permalink
chore: add a new workflow to integrate JIRA (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvbriones authored Aug 15, 2024
1 parent 27bdfa4 commit 0ef5361
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/qa_jira_ticket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit 0ef5361

Please sign in to comment.