From 39e8d4edbf304bcb535a22ebeeef5119d5d04e30 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Tue, 22 Jul 2025 13:54:03 +0100 Subject: [PATCH 1/6] chore: update JIRA automation --- .github/workflows/jira-issue.yml | 35 ++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml index 1d7bd170..1c54059b 100644 --- a/.github/workflows/jira-issue.yml +++ b/.github/workflows/jira-issue.yml @@ -3,32 +3,59 @@ name: Create JIRA ticket for new issues on: issues: - types: [opened] + types: [opened, labeled] permissions: issues: write contents: read + jobs: jira_task: name: Create Jira issue runs-on: ubuntu-latest + if: github.event.action == 'opened' || github.event.label.name == 'create-jira' steps: - uses: GitHubSecurityLab/actions-permissions/monitor@v1 with: config: ${{ vars.PERMISSIONS_CONFIG }} + - name: Create JIRA ticket uses: mongodb/apix-action/create-jira@v8 id: create + continue-on-error: true with: token: ${{ secrets.JIRA_API_TOKEN }} + api-base: https://jira.mongodb.org project-key: MCP summary: "HELP: GitHub Issue n. ${{ github.event.issue.number }}" - issuetype: Story - description: "This ticket tracks the following GitHub issue: ${{ github.event.issue.html_url }}." - components: MCP + issuetype: Task + + - name: Show result + run: | + echo "JIRA action result: ${{ steps.create.outputs.issue-key || 'FAILED' }}" + echo "Exit code: ${{ steps.create.outcome }}" + - name: Add comment + if: steps.create.outputs.issue-key uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: issue-number: ${{ github.event.issue.number }} body: | Thanks for opening this issue. The ticket [${{ steps.create.outputs.issue-key }}](https://jira.mongodb.org/browse/${{ steps.create.outputs.issue-key }}) was created for internal tracking. + + - name: Remove create-jira label + if: github.event.action == 'labeled' && github.event.label.name == 'create-jira' + uses: actions/github-script@v7 + with: + script: | + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: 'create-jira' + }); + console.log('✅ Removed create-jira label'); + } catch (error) { + console.log('⚠️ Could not remove create-jira label:', error.message); + } From b093edbe18b339c80976f6b97a6394a1e7f8d477 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Tue, 22 Jul 2025 14:02:28 +0100 Subject: [PATCH 2/6] update --- .github/workflows/jira-issue.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml index 1c54059b..fdf8746a 100644 --- a/.github/workflows/jira-issue.yml +++ b/.github/workflows/jira-issue.yml @@ -18,7 +18,7 @@ jobs: - uses: GitHubSecurityLab/actions-permissions/monitor@v1 with: config: ${{ vars.PERMISSIONS_CONFIG }} - + - name: Create JIRA ticket uses: mongodb/apix-action/create-jira@v8 id: create @@ -29,12 +29,12 @@ jobs: project-key: MCP summary: "HELP: GitHub Issue n. ${{ github.event.issue.number }}" issuetype: Task - + - name: Show result run: | echo "JIRA action result: ${{ steps.create.outputs.issue-key || 'FAILED' }}" echo "Exit code: ${{ steps.create.outcome }}" - + - name: Add comment if: steps.create.outputs.issue-key uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 @@ -42,7 +42,7 @@ jobs: issue-number: ${{ github.event.issue.number }} body: | Thanks for opening this issue. The ticket [${{ steps.create.outputs.issue-key }}](https://jira.mongodb.org/browse/${{ steps.create.outputs.issue-key }}) was created for internal tracking. - + - name: Remove create-jira label if: github.event.action == 'labeled' && github.event.label.name == 'create-jira' uses: actions/github-script@v7 From 186baab0d5f7f705cc8202a7db6f5923538841c5 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Tue, 22 Jul 2025 14:04:01 +0100 Subject: [PATCH 3/6] update --- .github/workflows/jira-issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml index fdf8746a..77a380aa 100644 --- a/.github/workflows/jira-issue.yml +++ b/.github/workflows/jira-issue.yml @@ -28,7 +28,7 @@ jobs: api-base: https://jira.mongodb.org project-key: MCP summary: "HELP: GitHub Issue n. ${{ github.event.issue.number }}" - issuetype: Task + issuetype: Bug - name: Show result run: | From f2f39664cbe3840ba047b81ee9c5f6e29db4bf4c Mon Sep 17 00:00:00 2001 From: Bianca Lisle <40155621+blva@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:31:03 +0100 Subject: [PATCH 4/6] Update .github/workflows/jira-issue.yml Co-authored-by: Filipe Constantinov Menezes --- .github/workflows/jira-issue.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml index 77a380aa..d621fe58 100644 --- a/.github/workflows/jira-issue.yml +++ b/.github/workflows/jira-issue.yml @@ -36,7 +36,6 @@ jobs: echo "Exit code: ${{ steps.create.outcome }}" - name: Add comment - if: steps.create.outputs.issue-key uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: issue-number: ${{ github.event.issue.number }} From 5a799519ae7e0cfa5a281329f0ef94623b8b5699 Mon Sep 17 00:00:00 2001 From: Bianca Lisle <40155621+blva@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:31:22 +0100 Subject: [PATCH 5/6] Update .github/workflows/jira-issue.yml Co-authored-by: Filipe Constantinov Menezes --- .github/workflows/jira-issue.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml index d621fe58..b35f6f85 100644 --- a/.github/workflows/jira-issue.yml +++ b/.github/workflows/jira-issue.yml @@ -33,7 +33,6 @@ jobs: - name: Show result run: | echo "JIRA action result: ${{ steps.create.outputs.issue-key || 'FAILED' }}" - echo "Exit code: ${{ steps.create.outcome }}" - name: Add comment uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 From f1f43f97f20f026f24dd628840f6a22cec9d5d23 Mon Sep 17 00:00:00 2001 From: Bianca Lisle <40155621+blva@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:14:02 +0100 Subject: [PATCH 6/6] Update .github/workflows/jira-issue.yml Co-authored-by: Filipe Constantinov Menezes --- .github/workflows/jira-issue.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml index b35f6f85..5b84ed92 100644 --- a/.github/workflows/jira-issue.yml +++ b/.github/workflows/jira-issue.yml @@ -25,7 +25,6 @@ jobs: continue-on-error: true with: token: ${{ secrets.JIRA_API_TOKEN }} - api-base: https://jira.mongodb.org project-key: MCP summary: "HELP: GitHub Issue n. ${{ github.event.issue.number }}" issuetype: Bug