Skip to content

Task1: this is a test to check JIRA integration #5

Task1: this is a test to check JIRA integration

Task1: this is a test to check JIRA integration #5

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