-
Notifications
You must be signed in to change notification settings - Fork 10
70 lines (59 loc) · 2.27 KB
/
issue-to-jira-ticket.yml
File metadata and controls
70 lines (59 loc) · 2.27 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
name: Create Jira Issue
on:
workflow_call:
issues:
types: ["opened"]
jobs:
create-issue:
name: "Create Issue"
runs-on: ubuntu-latest
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
steps:
- name: "Login"
uses: atlassian/gajira-login@master
- name: "Create"
id: create
uses: atlassian/gajira-create@master
with:
project: "SQDSDKS"
issuetype: "Story"
summary: |
${{ github.event.issue.title }}
description: |
${{ github.event.issue.body }}
fields: '{"parent": { "key": "SQDSDKS-4555" }}'
- name: "Create First Comment"
uses: atlassian/gajira-comment@master
with:
issue: ${{ steps.create.outputs.issue }}
comment: "GitHub Issue: ${{ github.event.issue.html_url }}"
- name: Link Jira Issue
run: |
curl -k -D- -u ${{ env.JIRA_USER_EMAIL }}:${{ env.JIRA_API_TOKEN }} -X POST -H 'Content-Type: application/json' -d \
'{"object": {"url":"${{ github.event.issue.html_url }}","title":"Github Issue Link: ${{ github.event.repository.full_name }}"}}' \
${{ env.JIRA_BASE_URL }}/rest/api/2/issue/${{ steps.create.outputs.issue }}/remotelink
- name: "Log created issue"
run: echo "Issue ${{ steps.create.outputs.issue }} was created"
- name: "Create Github comment"
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
Tracked internally as ${{ steps.create.outputs.issue }} was created
reactions: '+1'
- name: Create label
uses: actions-cool/issues-helper@v3
with:
actions: 'create-label'
label-name: ${{ steps.create.outputs.issue }}
label-color: '0095b3'
label-desc: ${{ steps.create.outputs.issue }}
- name: Add labels
uses: actions-cool/issues-helper@v3
with:
actions: 'add-labels'
issue-number: ${{ github.event.issue.number }}
labels: ${{ steps.create.outputs.issue }}