-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogramatically-create-jira-issues-from-github.yaml
More file actions
75 lines (69 loc) · 2.33 KB
/
programatically-create-jira-issues-from-github.yaml
File metadata and controls
75 lines (69 loc) · 2.33 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Jira Issue Creation
on:
workflow_dispatch:
inputs:
TYPE_OF_ISSUE:
description: 'Type of Jira issue to be created (Epic, Task, Subtask)'
type: choice
options:
- "Epic"
- "Task"
- "Subtask"
required: true
JIRA_BOARD:
description: 'Your Jira board key'
type: string
required: true
ISSUE_SUMMARY:
description: 'Issue summary'
type: string
required: true
ISSUE_DESCRIPTION:
description: 'Issue description'
type: string
required: true
EPIC_KEY:
description: 'Jira EPIC id to attach issue'
type: string
required: false
STORY_KEY:
type: string
description: 'Jira story key to attach sub task'
required: false
jobs:
create-jira-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Specify the Python version you need
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Run Jira Issue Creation Script
env:
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }}
JIRA_PASSWORD: ${{ secrets.JIRA_PASSWORD }}
run: |
EPIC_KEY_OPTION=""
if [ -n "${{ github.event.inputs.EPIC_KEY }}" ]; then
EPIC_KEY_OPTION="--epic_key ${{ github.event.inputs.EPIC_KEY }}"
fi
STORY_KEY_OPTION=""
if [ -n "${{ github.event.inputs.STORY_KEY }}" ]; then
STORY_KEY_OPTION="--story_key ${{ github.event.inputs.STORY_KEY }}"
fi
poetry run python3 jira.py --type_of_issue ${{ github.event.inputs.TYPE_OF_ISSUE }} \
--jira_board ${{ github.event.inputs.JIRA_BOARD }} \
--summary "${{ github.event.inputs.ISSUE_SUMMARY }}" \
--description "${{ github.event.inputs.ISSUE_DESCRIPTION }}" \
$EPIC_KEY_OPTION \
$STORY_KEY_OPTION
- name: Process completed
run: |
echo "Script execution completed"