From 0b4dc2574e3754160ef74d5c946aedd556eb0347 Mon Sep 17 00:00:00 2001 From: Tu Nguyen Date: Mon, 20 Mar 2023 09:27:29 -0700 Subject: [PATCH] Update GH actions to create Jira issue automatically (#16656) --- .github/workflows/jira-issues.yaml | 20 ++++++++++++++++++++ .github/workflows/jira-pr.yaml | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/.github/workflows/jira-issues.yaml b/.github/workflows/jira-issues.yaml index 07b71e83d4..ecda1dddf8 100644 --- a/.github/workflows/jira-issues.yaml +++ b/.github/workflows/jira-issues.yaml @@ -54,6 +54,26 @@ jobs: JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + # Education Jira + - name: Create ticket in Education board an issue is filed, or if PR not by a team member is opened + if: github.event.action == 'opened' && ("${{ contains(github.event.issue.labels.*.name, 'type/docs') }}" == "true") + uses: tomhjp/gh-action-jira-create@v0.2.0 + with: + project: CE + issuetype: "${{ steps.set-ticket-type.outputs.TYPE }}" + summary: "${{ github.event.repository.name }} [${{ steps.set-ticket-type.outputs.TYPE }} #${{ github.event.issue.number }}]: ${{ github.event.issue.title }}" + description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created in GitHub by ${{ github.actor }}._" + # customfield_10089 is "Issue Link", customfield_10371 is "Source" (use JIRA API to retrieve) + extraFields: '{ "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}", + "customfield_10371": { "value": "GitHub" }, + "customfield_10535": [{ "value": "Service Mesh" }], + "components": [{ "name": "${{ github.event.repository.name }}" }], + "labels": ${{ steps.set-ticket-labels.outputs.LABELS }} }' + env: + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + - name: Search if: github.event.action != 'opened' id: search diff --git a/.github/workflows/jira-pr.yaml b/.github/workflows/jira-pr.yaml index 706efa61a4..b083e58fe1 100644 --- a/.github/workflows/jira-pr.yaml +++ b/.github/workflows/jira-pr.yaml @@ -72,6 +72,22 @@ jobs: JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + + # Education Jira + - name: Create ticket in Education board an issue is filed, or if PR not by a team member is opened + if: github.event.action == 'opened' && ("${{ contains(github.event.issue.labels.*.name, 'type/docs') }}" == "true") + uses: tomhjp/gh-action-jira-create@v0.2.0 + with: + project: CE + issuetype: "${{ steps.set-ticket-type.outputs.TYPE }}" + summary: "${{ github.event.repository.name }} [${{ steps.set-ticket-type.outputs.TYPE }} #${{ github.event.issue.number }}]: ${{ github.event.issue.title }}" + description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created in GitHub by ${{ github.actor }}._" + # customfield_10089 is "Issue Link", customfield_10371 is "Source" (use JIRA API to retrieve) + extraFields: '{ "customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}", + "customfield_10371": { "value": "GitHub" }, + "customfield_10535": [{ "value": "Service Mesh" }], + "components": [{ "name": "${{ github.event.repository.name }}" }], + "labels": ${{ steps.set-ticket-labels.outputs.LABELS }} }' - name: Search if: github.event.action != 'opened'