Skip to content

Conversation

@kamio90
Copy link
Contributor

@kamio90 kamio90 commented Nov 19, 2025

…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.


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 workflow (update_jira/index.js):
    • Remove resolution from transitionFields for staging and dev (non-final states) while keeping production transitions unchanged.
  • Utilities:
    • Add tmp/list-custom-fields.js to enumerate Jira custom fields and validate expected IDs.
    • Add tmp/test-custom-fields.js to update/verify deployment-related custom fields on an issue, with optional rollback.
    • Add tmp/verify-staging-flow.js to 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.

…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.
Copy link

@cursor cursor bot left a 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
Copy link

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.

Fix in Cursor Fix in Web

Copy link

Copilot AI left a 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 resolution field 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.

Comment on lines +8 to +9
* Usage: node utils/verify-staging-flow.js [ISSUE_KEY]
* Example: node utils/verify-staging-flow.js DEX-36
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
* 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

Copilot uses AI. Check for mistakes.
process.exit(1)
}

console.log(`\n${ '='.repeat(80)}`)
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
console.log(`\n${ '='.repeat(80)}`)
console.log(`\n${'='.repeat(80)}`)

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +12
* node utils/test-custom-fields.js [ISSUE_KEY]
*
* Example:
* node utils/test-custom-fields.js DEX-36
Copy link

Copilot AI Nov 19, 2025

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].

Suggested change
* 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

Copilot uses AI. Check for mistakes.

if (releaseFields.length > 0) {
console.log('\n🎯 RELEASE/DEPLOYMENT RELATED FIELDS:')
console.log('=' .repeat(100))
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
console.log('=' .repeat(100))
console.log('='.repeat(100))

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +9
* Usage: node utils/verify-staging-flow.js [ISSUE_KEY]
* Example: node utils/verify-staging-flow.js DEX-36
Copy link

Copilot AI Nov 19, 2025

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].

Suggested change
* 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

Copilot uses AI. Check for mistakes.
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`)
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
console.log(`${'='.repeat(80) }\n`)
console.log(`${'='.repeat(80)}\n`)

Copilot uses AI. Check for mistakes.
console.log('='.repeat(80))
console.log(`Issue: ${issueKey}`)
console.log(`Jira URL: ${JIRA_BASE_URL}`)
console.log(`${'='.repeat(80) }\n`)
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
console.log(`${'='.repeat(80) }\n`)
console.log(`${'='.repeat(80)}\n`)

Copilot uses AI. Check for mistakes.
// Step 6: Offer to rollback
console.log('='.repeat(80))
console.log('✅ ALL TESTS PASSED!')
console.log(`${'='.repeat(80) }\n`)
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
console.log(`${'='.repeat(80) }\n`)
console.log(`${'='.repeat(80)}\n`)

Copilot uses AI. Check for mistakes.

console.log(`\n${ '='.repeat(80)}`)
console.log('🎉 Test completed successfully!')
console.log(`${'='.repeat(80) }\n`)
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
console.log(`${'='.repeat(80) }\n`)
console.log(`${'='.repeat(80)}\n`)

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +12
* node utils/test-custom-fields.js [ISSUE_KEY]
*
* Example:
* node utils/test-custom-fields.js DEX-36
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
* 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

Copilot uses AI. Check for mistakes.
@kamio90 kamio90 merged commit 67e44df into main Nov 20, 2025
8 of 9 checks passed
@kamio90 kamio90 deleted the DEX-36/fix-jira-integration-part-2 branch November 20, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant