Skip to content

Fixed the crash (TypeError: Cannot read properties of undefined (read…#101

Merged
AshleyDawson merged 1 commit into
mainfrom
feature/sr-262-jira-app-integration-fails-to-load-on-specific-ticket-due-to
Jul 6, 2026
Merged

Fixed the crash (TypeError: Cannot read properties of undefined (read…#101
AshleyDawson merged 1 commit into
mainfrom
feature/sr-262-jira-app-integration-fails-to-load-on-specific-ticket-due-to

Conversation

@AshleyDawson

@AshleyDawson AshleyDawson commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fix for: https://linear.app/deskpro/issue/SR-262/jira-app-integration-fails-to-load-on-specific-ticket-due-to

Summary by Sourcery

Prevent Jira app integration from crashing when loading linked issues for tickets with epics missing summary data.

Bug Fixes:

  • Ensure Jira epic summaries are explicitly requested and safely accessed to avoid TypeError crashes in linked issues listing.

Build:

  • Bump Jira app manifest version to 1.0.74.

…ing 'summary')) when loading linked Jira issues that belong to an epic.
@AshleyDawson
AshleyDawson requested a review from a team as a code owner July 6, 2026 10:59
@sourcery-ai

sourcery-ai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Jira app integration crash fix by making epic summary field access safe and limiting Jira search results to include the summary field, plus a manifest version bump.

Sequence diagram for updated Jira epic summary retrieval

sequenceDiagram
  participant listLinkedIssues
  participant jiraRequest
  participant JiraAPI

  listLinkedIssues->>jiraRequest: jiraRequest(client, { endpoint: /search/jql?jql=epicJql&fields=summary })
  jiraRequest->>JiraAPI: GET /search/jql?jql=epicJql&fields=summary
  JiraAPI-->>jiraRequest: SearchIssues (issues with fields.summary)
  jiraRequest-->>listLinkedIssues: SearchIssues
  listLinkedIssues->>listLinkedIssues: reduce epics, set epicName = epic.fields.summary
  alt [epic or fields missing]
    listLinkedIssues->>listLinkedIssues: epicName = undefined (safe access epic.fields?.summary)
  end
Loading

File-Level Changes

Change Details Files
Prevent TypeError when reading epic summary by aligning Jira search fields and making nested field access defensive.
  • Update Jira search request to explicitly request the summary field for epics
  • Use optional chaining when accessing epic fields.summary to avoid crashes when fields is undefined
  • Keep linked issue mapping logic and other fields (status, sprints, custom fields) unchanged
src/api/issues/listLinkedIssues/listLinkedIssues.ts
Bump Jira app manifest version to reflect the crash fix release.
  • Increment manifest version from 1.0.63 to 1.0.74
manifest.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider URL-encoding epicJql before interpolating it into the /search/jql endpoint, as special characters in the JQL could break the request or lead to unexpected behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider URL-encoding `epicJql` before interpolating it into the `/search/jql` endpoint, as special characters in the JQL could break the request or lead to unexpected behavior.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@AshleyDawson
AshleyDawson merged commit a12976f into main Jul 6, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants