From f843b7829290058f92de4ca952d1ec01e78210ff Mon Sep 17 00:00:00 2001 From: Melanija Cvetic Date: Wed, 4 Mar 2026 15:16:39 +0000 Subject: [PATCH 1/3] chore: Add automatic jira creation and closure for gh issues --- .github/workflows/jira-issue.yml | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/jira-issue.yml diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml new file mode 100644 index 0000000..81985f6 --- /dev/null +++ b/.github/workflows/jira-issue.yml @@ -0,0 +1,95 @@ + +--- + # This workflow automatically creates JIRA tickets when GitHub issues are opened + # and closes JIRA tickets when GitHub issues are closed. + # + # Required secrets: + # - JIRA_API_TOKEN: Your JIRA API token + # + name: Create and close JIRA tickets for GitHub issues + + on: + issues: + types: [opened, closed] + + permissions: + issues: write + contents: read + + jobs: + jira_task: + name: Create Jira issue + runs-on: ubuntu-latest + if: github.event.action == 'opened' + steps: + - uses: GitHubSecurityLab/actions-permissions/monitor@v1 + with: + config: ${{ vars.PERMISSIONS_CONFIG }} + - name: Create JIRA ticket + uses: mongodb/apix-action/create-jira@v13 + id: create + with: + token: ${{ secrets.JIRA_API_TOKEN }} + project-key: CLOUDP + 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: AtlasCLI + assignee: ${{ vars.ASSIGNEE_JIRA_TICKET }} + extra-data: | + { + "fields": { + "fixVersions": [ + { + "name": "Not Applicable" + } + ], + "customfield_12751": [ + { + "id": "22223" + } + ], + "customfield_10257": { + "id": "11861" + } + } + } + - name: Add comment + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 + 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. + + close_jira_task: + name: Close Jira issue + runs-on: ubuntu-latest + if: github.event.action == 'closed' + steps: + - uses: GitHubSecurityLab/actions-permissions/monitor@v1 + with: + config: ${{ vars.PERMISSIONS_CONFIG }} + + - name: Find JIRA ticket by GitHub issue number + id: find_jira + uses: mongodb/apix-action/find-jira@v13 + with: + token: ${{ secrets.JIRA_API_TOKEN }} + jql: "project = CLOUDP AND description ~ '${{ github.event.issue.html_url }}'" + + - name: Close JIRA ticket + if: steps.find_jira.outputs.found == 'true' + uses: mongodb/apix-action/transition-jira@v13 + id: close_jira_ticket + continue-on-error: true + with: + token: ${{ secrets.JIRA_API_TOKEN }} + issue-key: ${{ steps.find_jira.outputs.issue-key }} + transition-id: 1381 # Resolved + - name: Add closure comment + if: steps.close_jira_ticket.outcome == 'success' + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 + with: + issue-number: ${{ github.event.issue.number }} + body: | + The corresponding JIRA ticket has been automatically closed. From 521245c91923d80b388192af8310f7eaeb92e064 Mon Sep 17 00:00:00 2001 From: Melanija Cvetic Date: Wed, 11 Mar 2026 13:50:50 +0000 Subject: [PATCH 2/3] adds task for gh issue reopened --- .github/workflows/jira-issue.yml | 42 +++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jira-issue.yml b/.github/workflows/jira-issue.yml index 81985f6..b1e2134 100644 --- a/.github/workflows/jira-issue.yml +++ b/.github/workflows/jira-issue.yml @@ -1,7 +1,8 @@ --- - # This workflow automatically creates JIRA tickets when GitHub issues are opened - # and closes JIRA tickets when GitHub issues are closed. + # This workflow automatically creates JIRA tickets when GitHub issues are opened, + # closes JIRA tickets when GitHub issues are closed, and reopens JIRA tickets + # when GitHub issues are reopened. # # Required secrets: # - JIRA_API_TOKEN: Your JIRA API token @@ -10,14 +11,14 @@ on: issues: - types: [opened, closed] + types: [opened, closed, reopened] permissions: issues: write contents: read jobs: - jira_task: + open_jira_task: name: Create Jira issue runs-on: ubuntu-latest if: github.event.action == 'opened' @@ -93,3 +94,36 @@ issue-number: ${{ github.event.issue.number }} body: | The corresponding JIRA ticket has been automatically closed. + + reopen_jira_task: + name: Reopen Jira issue + runs-on: ubuntu-latest + if: github.event.action == 'reopened' + steps: + - uses: GitHubSecurityLab/actions-permissions/monitor@v1 + with: + config: ${{ vars.PERMISSIONS_CONFIG }} + + - name: Find JIRA ticket by GitHub issue number + id: find_jira + uses: mongodb/apix-action/find-jira@v13 + with: + token: ${{ secrets.JIRA_API_TOKEN }} + jql: "project = CLOUDP AND description ~ '${{ github.event.issue.html_url }}'" + + - name: Reopen JIRA ticket + if: steps.find_jira.outputs.found == 'true' + uses: mongodb/apix-action/transition-jira@v13 + id: reopen_jira_ticket + continue-on-error: true + with: + token: ${{ secrets.JIRA_API_TOKEN }} + issue-key: ${{ steps.find_jira.outputs.issue-key }} + transition-id: 1351 # Reopened + - name: Add reopen comment + if: steps.reopen_jira_ticket.outcome == 'success' + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 + with: + issue-number: ${{ github.event.issue.number }} + body: | + The corresponding JIRA ticket has been automatically reopened for internal tracking. From c9d440d4b6f0f034d9d461cc9076ea6f4122bd3c Mon Sep 17 00:00:00 2001 From: Melanija Cvetic Date: Mon, 16 Mar 2026 10:32:48 +0000 Subject: [PATCH 3/3] fly-by --- .github/CODEOWNERS | 2 +- .github/dependabot.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e89c00f..30e55e3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # Maintained by the MongoDB Atlas CLI team -* @mongodb/apix-2 +* @mongodb/apix-devtools # Docs maintained by Docs Cloud Team /docs/ @mongodb/docs-cloud-team diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b9d7dc8..dcb7cdf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,5 +5,3 @@ updates: schedule: interval: weekly day: monday - reviewers: - - "mongodb/apix-2"