Skip to content
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

[MM-1121]: Fix epic selector not displaying options if field is renamed in Jira #1134

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kshitij-Katiyar
Copy link
Contributor

@Kshitij-Katiyar Kshitij-Katiyar commented Nov 5, 2024

Summary

  • The Create Issue modal had a bug: if the Epic field in a Jira project was renamed to anything other than Epic, the dropdown for selecting Jira epics displayed no options.
  • The existing logic iterates over each field in the Jira project, filtering for fields named Epic, and then checks if the filtered field matches the Epic field schema before fetching all epics from the project.
  • The bug occurred because the code depended solely on finding a field named Epic. This PR removes the name-based check and instead relies exclusively on the field schema to identify the Epic field.

Ticket Link

Fixes #1121

What to test

  • Create different fields of epic type in a Jira project
  • Look for the Epic link field in the Create Issue modal

Screenshot from 2024-11-05 13-54-22

Copy link
Contributor

@raghavaggarwal2308 raghavaggarwal2308 left a comment

Choose a reason for hiding this comment

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

Please add proper QA testing steps. As the QA will not know about renaming the fields on Jira side.

Comment on lines +57 to +59
if (epicNameTypeId) {
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This will always be false. I think we can remove this

Comment on lines +89 to +91
if (epicNameTypeId) {
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Never true, can be removed

Comment on lines +80 to +88
for (const project of this.props.issueMetadata.projects) {
for (const issueType of project.issuetypes) {
epicNameTypeId = Object.keys(issueType.fields).find((key) => isEpicNameField(issueType.fields[key]));
if (epicNameTypeId) {
epicIssueTypeId = issueType.id;
projectKey = project.key;
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can create a util for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Epic Link field show no options if Epic are renamed
2 participants