Skip to content

Commit 33ea6fe

Browse files
tvorantomhjp
andauthored
Update jira team to be applications (#100)
And use the common jira workflow Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
1 parent 4409727 commit 33ea6fe

1 file changed

Lines changed: 8 additions & 63 deletions

File tree

.github/workflows/jira.yaml

Lines changed: 8 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,17 @@
1+
name: Jira Sync
12
on:
23
issues:
34
types: [opened, closed, deleted, reopened]
45
pull_request_target:
56
types: [opened, closed, reopened]
67
issue_comment: # Also triggers when commenting on a PR from the conversation view
78
types: [created]
8-
9-
name: Jira Sync
10-
119
jobs:
1210
sync:
13-
runs-on: ubuntu-latest
14-
name: Jira sync
15-
steps:
16-
- name: Login
17-
uses: atlassian/gajira-login@v2.0.0
18-
env:
19-
JIRA_BASE_URL: ${{ secrets.JIRA_SYNC_BASE_URL }}
20-
JIRA_USER_EMAIL: ${{ secrets.JIRA_SYNC_USER_EMAIL }}
21-
JIRA_API_TOKEN: ${{ secrets.JIRA_SYNC_API_TOKEN }}
22-
23-
- name: Preprocess
24-
if: github.event.action == 'opened' || github.event.action == 'created'
25-
id: preprocess
26-
run: |
27-
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
28-
echo "::set-output name=type::PR"
29-
else
30-
echo "::set-output name=type::ISS"
31-
fi
32-
33-
- name: Create ticket
34-
if: github.event.action == 'opened'
35-
uses: tomhjp/gh-action-jira-create@v0.2.0
36-
with:
37-
project: VAULT
38-
issuetype: "GH Issue"
39-
summary: "${{ github.event.repository.name }} [${{ steps.preprocess.outputs.type }} #${{ github.event.issue.number || github.event.pull_request.number }}]: ${{ github.event.issue.title || github.event.pull_request.title }}"
40-
description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created from GitHub Action for ${{ github.event.issue.html_url || github.event.pull_request.html_url }} from ${{ github.actor }}_"
41-
# customfield_10089 is Issue Link custom field
42-
# customfield_10091 is team custom field
43-
extraFields: '{"fixVersions": [{"name": "TBD"}], "customfield_10091": ["ecosystem", "foundations"], "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}"}'
44-
45-
- name: Search
46-
if: github.event.action != 'opened'
47-
id: search
48-
uses: tomhjp/gh-action-jira-search@v0.2.1
49-
with:
50-
# cf[10089] is Issue Link custom field
51-
jql: 'project = "VAULT" and cf[10089]="${{ github.event.issue.html_url || github.event.pull_request.html_url }}"'
52-
53-
- name: Sync comment
54-
if: github.event.action == 'created' && steps.search.outputs.issue
55-
uses: tomhjp/gh-action-jira-comment@v0.2.0
56-
with:
57-
issue: ${{ steps.search.outputs.issue }}
58-
comment: "${{ github.actor }} ${{ github.event.review.state || 'commented' }}:\n\n${{ github.event.comment.body || github.event.review.body }}\n\n${{ github.event.comment.html_url || github.event.review.html_url }}"
59-
60-
- name: Close ticket
61-
if: (github.event.action == 'closed' || github.event.action == 'deleted') && steps.search.outputs.issue
62-
uses: atlassian/gajira-transition@v2.0.1
63-
with:
64-
issue: ${{ steps.search.outputs.issue }}
65-
transition: Closed
66-
67-
- name: Reopen ticket
68-
if: github.event.action == 'reopened' && steps.search.outputs.issue
69-
uses: atlassian/gajira-transition@v2.0.1
70-
with:
71-
issue: ${{ steps.search.outputs.issue }}
72-
transition: "Pending Triage"
11+
uses: hashicorp/vault-workflows-common/.github/workflows/jira.yaml@main
12+
secrets:
13+
JIRA_SYNC_BASE_URL: ${{ secrets.JIRA_SYNC_BASE_URL }}
14+
JIRA_SYNC_USER_EMAIL: ${{ secrets.JIRA_SYNC_USER_EMAIL }}
15+
JIRA_SYNC_API_TOKEN: ${{ secrets.JIRA_SYNC_API_TOKEN }}
16+
with:
17+
teams-array: '["ecosystem", "applications"]'

0 commit comments

Comments
 (0)