From 5f9f12a5ac12397d7b3112a8d2377eaa0c534c1d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 27 Nov 2023 18:58:43 -0400 Subject: [PATCH] chore: Add GitHub -> Jira automation for syncing issues Enables GitHub to Jira synchronization for new issues --- .github/workflows/issues.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/issues.yaml diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml new file mode 100644 index 0000000..9485eb6 --- /dev/null +++ b/.github/workflows/issues.yaml @@ -0,0 +1,31 @@ +name: Issues to JIRA + +on: + issues: + types: [opened, reopened, closed] + +jobs: + update: + name: Update Issue + runs-on: ubuntu-latest + steps: + - name: Create JIRA ticket + env: + ISSUE_TITLE: ${{ github.event.issue.title }} + ISSUE_DESCRIPTION: ${{ github.event.issue.body }} + run: | + if ${{ contains(github.event.*.labels.*.name, 'Bug') }}; then + type=bug + else + type=story + fi + data=$( jq -n \ + --arg title "$ISSUE_TITLE" \ + --arg url '${{ github.event.issue.html_url }}' \ + --arg submitter '${{ github.event.issue.user.login }}' \ + --arg body "" \ + --arg type "$type" \ + --arg action '${{ github.event.action }}' \ + '{title: $title, url: $url, submitter: $submitter, body: $body, type: $type, action: $action}' ) + + curl -X POST -H 'Content-type: application/json' --data "${data}" "${{ secrets.JIRA_URL }}"