-
Notifications
You must be signed in to change notification settings - Fork 167
50 lines (45 loc) · 1.63 KB
/
gh2jira.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
40
41
42
43
44
45
46
47
48
49
50
name: GitHub issue to Jira issue
on:
issues:
types: [ opened ]
jobs:
gh2jira:
runs-on: ubuntu-latest
name: Github Issue To Jira Issue
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Create
id: create
if: ${{ !github.event.issue.pull_request }}
uses: atlassian/gajira-create@master
with:
project: CORE
issuetype: Problem
summary: |
GH #${{ github.event.issue.number }}: ${{ github.event.issue.title }}
description: |
Reported by GitHub user: ${{ github.event.issue.user.login }}.
${{ github.event.issue.html_url }}
${{ github.event.issue.body }}
fields: | # as a textual representation of json because reasons
{
"assignee": {
"name": "${{ secrets.CORE_DEFAULT_JIRA_ASSIGNEE }}"
}
}
- name: Log created issue
run: echo "Issue ${{ steps.create.outputs.issue }} was created"
# Notes:
# Re: Jira Actions
# https://github.com/marketplace/actions/jira-login
# https://github.com/marketplace/actions/jira-create-issue
# https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-createIssue
# Re: triggering gh actions on issue activity
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues
# Re: issue fields
# https://docs.github.com/en/rest/issues/issues#get-an-issue