Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions .github/workflows/jira-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,59 @@ name: Create JIRA ticket for new issues

on:
issues:
types: [opened]
types: [opened, labeled]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you adding the label feature? For old issues?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, if we want to trigger jira creation we can


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: Bug
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the description and components fields may result in incomplete JIRA tickets. Consider adding these back to provide better context and organization in JIRA.

Suggested change
issuetype: Bug
issuetype: Bug
description: ${{ github.event.issue.body || 'No description provided.' }}
components: ${{ github.event.label.name || 'Default Component' }}

Copilot uses AI. Check for mistakes.


- name: Show result
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is incorrect for this step. It should be aligned with other steps at the same level (6 spaces), not as a sub-item of the previous step (8 spaces).

Copilot uses AI. Check for mistakes.

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);
}
Loading