Skip to content

fix(jira): fill epic_key from the parent issue for search API responses - #9464

Open
Alexandrshy wants to merge 1 commit into
apache:mainfrom
Alexandrshy:fix/jira-epic-key-from-parent
Open

Alexandrshy wants to merge 1 commit into
apache:mainfrom
Alexandrshy:fix/jira-epic-key-from-parent

Conversation

@Alexandrshy

Copy link
Copy Markdown
Contributor

⚠️ Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation.
  • I have added relevant tests.
  • I have added relevant documentation.
  • I will add labels to the PR, such as pr-type/bug-fix, pr-type/feature-development, etc.

Summary

Since #8931 Jira issues are collected through the search API. Its responses have no fields.epic: that is a field of the Agile API, like fields.sprint (#9410). epic_key was taken from fields.epic only, so it is empty for every issue collected since then, unless Epic Key Field is set in the scope config (#9067). issues.epic_key is empty as well, and collectEpics, which builds its list of epics from epic_key, collects fewer and fewer of them (details in #).

In search API responses the epic of an issue is its parent. This PR fills EpicKey from fields.parent when fields.epic is absent and the parent is an issue of the epic level (fields.parent.fields.issuetype.hierarchyLevel is 1):

  • The level is checked, not the type name: epic issue types get renamed and localized. Jira Cloud reports -1 for sub-tasks, 0 for standard issue types and 1 for epics.
  • fields.epic still wins when it is present (raw data collected before fix(jira): collect issues via search API to avoid kanban sub-filter exclusion #8931), and Epic Key Field from the scope config still overrides both.
  • A parent with another level (the parent of a sub-task, an issue above the epic level) or without hierarchyLevel is ignored, so responses that do not carry it are extracted as before.

TestExtractIssuesEpicKeyFromParent covers these cases. Its first case fails on main.

Does this close any open issues?

Closes #9463

Screenshots

N/A

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.

[Bug][Jira] epic_key is empty for issues collected through the search API

1 participant