-
Notifications
You must be signed in to change notification settings - Fork 0
fix: Remove resolution field from staging/dev transitions to prevent … #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…400 errors - Remove resolution field from 'Deployed to Staging' and 'Merged' status transitions - Resolution field can only be set on final states like 'Done', not intermediate states - This allows transitions to succeed and custom fields to be updated properly - Add utility scripts to verify and test custom field updates Fixes issue where staging deployments failed with: 'Field resolution cannot be set. It is not on the appropriate screen' Custom fields (Stage Release Timestamp, Production Release Timestamp, Release Environment) will now be updated correctly after successful transitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on November 24
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| status: 'Merged', | ||
| transitionFields: { | ||
| resolution: 'Done', | ||
| // No resolution field - "Merged" is not a final state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Deployment timestamps created at module load time, not deployment time
The statusMap object defines custom field timestamps using new Date() at module initialization time. This means all deployments will share the same timestamp (from when the module was first loaded), rather than capturing the actual deployment time. Timestamps should be created dynamically when deployments occur, not when the module is parsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a critical issue where Jira status transitions to intermediate states ("Deployed to Staging" and "Merged") were failing with 400 errors due to inappropriately setting the resolution field, which can only be set on final states like "Done".
- Removes
resolutionfield from staging and dev transition configurations in the status map - Adds three utility scripts for testing and verifying custom field updates in Jira
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 17 comments.
| File | Description |
|---|---|
| update_jira/index.js | Removes resolution field from staging and dev transitions, replacing with explanatory comments |
| tmp/verify-staging-flow.js | Adds verification script to simulate staging deployment flow and verify custom field updates |
| tmp/test-custom-fields.js | Adds interactive test script for verifying custom field updates with rollback capability |
| tmp/list-custom-fields.js | Adds utility script to list and verify all custom fields in the Jira instance |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Usage: node utils/verify-staging-flow.js [ISSUE_KEY] | ||
| * Example: node utils/verify-staging-flow.js DEX-36 |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example path references utils/verify-staging-flow.js, but this file is located in tmp/. The path should be node tmp/verify-staging-flow.js DEX-36.
| * Usage: node utils/verify-staging-flow.js [ISSUE_KEY] | |
| * Example: node utils/verify-staging-flow.js DEX-36 | |
| * Usage: node tmp/verify-staging-flow.js [ISSUE_KEY] | |
| * Example: node tmp/verify-staging-flow.js DEX-36 |
| process.exit(1) | ||
| } | ||
|
|
||
| console.log(`\n${ '='.repeat(80)}`) |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template literal has an extra space before '='.repeat(80). This should be \n${'='.repeat(80)} for consistent formatting.
| console.log(`\n${ '='.repeat(80)}`) | |
| console.log(`\n${'='.repeat(80)}`) |
| * node utils/test-custom-fields.js [ISSUE_KEY] | ||
| * | ||
| * Example: | ||
| * node utils/test-custom-fields.js DEX-36 |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage path references utils/test-custom-fields.js, but this file is located in tmp/. The path should be node tmp/test-custom-fields.js [ISSUE_KEY].
| * node utils/test-custom-fields.js [ISSUE_KEY] | |
| * | |
| * Example: | |
| * node utils/test-custom-fields.js DEX-36 | |
| * node tmp/test-custom-fields.js [ISSUE_KEY] | |
| * | |
| * Example: | |
| * node tmp/test-custom-fields.js DEX-36 |
|
|
||
| if (releaseFields.length > 0) { | ||
| console.log('\n🎯 RELEASE/DEPLOYMENT RELATED FIELDS:') | ||
| console.log('=' .repeat(100)) |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra space in '=' .repeat(100). This should be '='.repeat(100) for consistent formatting.
| console.log('=' .repeat(100)) | |
| console.log('='.repeat(100)) |
| * Usage: node utils/verify-staging-flow.js [ISSUE_KEY] | ||
| * Example: node utils/verify-staging-flow.js DEX-36 |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage path references utils/verify-staging-flow.js, but this file is located in tmp/. The path should be node tmp/verify-staging-flow.js [ISSUE_KEY].
| * Usage: node utils/verify-staging-flow.js [ISSUE_KEY] | |
| * Example: node utils/verify-staging-flow.js DEX-36 | |
| * Usage: node tmp/verify-staging-flow.js [ISSUE_KEY] | |
| * Example: node tmp/verify-staging-flow.js DEX-36 |
| console.log(' 5. Release Environment will be set to "Staging" ✅') | ||
| console.log() | ||
| console.log('🎉 The pipeline WILL update custom fields correctly!') | ||
| console.log(`${'='.repeat(80) }\n`) |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template literal has trailing spaces after '='.repeat(80). This should be ${'='.repeat(80)}\n for consistent formatting.
| console.log(`${'='.repeat(80) }\n`) | |
| console.log(`${'='.repeat(80)}\n`) |
| console.log('='.repeat(80)) | ||
| console.log(`Issue: ${issueKey}`) | ||
| console.log(`Jira URL: ${JIRA_BASE_URL}`) | ||
| console.log(`${'='.repeat(80) }\n`) |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template literal has trailing spaces after '='.repeat(80). This should be ${'='.repeat(80)}\n for consistent formatting.
| console.log(`${'='.repeat(80) }\n`) | |
| console.log(`${'='.repeat(80)}\n`) |
| // Step 6: Offer to rollback | ||
| console.log('='.repeat(80)) | ||
| console.log('✅ ALL TESTS PASSED!') | ||
| console.log(`${'='.repeat(80) }\n`) |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template literal has trailing spaces after '='.repeat(80). This should be ${'='.repeat(80)}\n for consistent formatting.
| console.log(`${'='.repeat(80) }\n`) | |
| console.log(`${'='.repeat(80)}\n`) |
|
|
||
| console.log(`\n${ '='.repeat(80)}`) | ||
| console.log('🎉 Test completed successfully!') | ||
| console.log(`${'='.repeat(80) }\n`) |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template literal has trailing spaces after '='.repeat(80). This should be ${'='.repeat(80)}\n for consistent formatting.
| console.log(`${'='.repeat(80) }\n`) | |
| console.log(`${'='.repeat(80)}\n`) |
| * node utils/test-custom-fields.js [ISSUE_KEY] | ||
| * | ||
| * Example: | ||
| * node utils/test-custom-fields.js DEX-36 |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example path references utils/test-custom-fields.js, but this file is located in tmp/. The path should be node tmp/test-custom-fields.js DEX-36.
| * node utils/test-custom-fields.js [ISSUE_KEY] | |
| * | |
| * Example: | |
| * node utils/test-custom-fields.js DEX-36 | |
| * node tmp/test-custom-fields.js [ISSUE_KEY] | |
| * | |
| * Example: | |
| * node tmp/test-custom-fields.js DEX-36 |
…400 errors
Fixes issue where staging deployments failed with: 'Field resolution cannot be set. It is not on the appropriate screen'
Custom fields (Stage Release Timestamp, Production Release Timestamp, Release Environment) will now be updated correctly after successful transitions.
Note
Removes the resolution field from staging/dev transitions to prevent 400 errors and adds scripts to list, test, and verify Jira custom field updates.
update_jira/index.js):resolutionfromtransitionFieldsforstaginganddev(non-final states) while keeping production transitions unchanged.tmp/list-custom-fields.jsto enumerate Jira custom fields and validate expected IDs.tmp/test-custom-fields.jsto update/verify deployment-related custom fields on an issue, with optional rollback.tmp/verify-staging-flow.jsto simulate and verify the staging deployment flow and custom field updates.Written by Cursor Bugbot for commit 18a9e1d. This will update automatically on new commits. Configure here.