Skip to content

fix(jira): Populate WorkItem.Body from issue description#1000

Open
kelos-bot[bot] wants to merge 1 commit intomainfrom
kelos-task-990
Open

fix(jira): Populate WorkItem.Body from issue description#1000
kelos-bot[bot] wants to merge 1 commit intomainfrom
kelos-task-990

Conversation

@kelos-bot
Copy link
Copy Markdown

@kelos-bot kelos-bot Bot commented Apr 16, 2026

What type of PR is this?

/kind bug

What this PR does / why we need it:

The Jira source never fetched the issue description from the Jira API, so the documented {{.Body}} template variable silently evaluated to an empty string in every Jira-based prompt template — even though both docs/integration.md and the official example use it.

This PR:

  1. Adds description to the fields query parameter sent to the Jira search API so the description is actually returned.
  2. Extends jiraIssueFields with a Description interface{} field. Jira Data Center/Server returns descriptions as plain strings while Jira Cloud returns Atlassian Document Format objects, matching the existing comment-body shape.
  3. Populates WorkItem.Body in Discover using the existing commentBodyToString helper, which already handles both shapes.
  4. Adds a TestJiraDiscoverDescription test covering plain-string descriptions (Data Center), ADF descriptions (Cloud), and missing descriptions.

Which issue(s) this PR is related to:

Fixes #990

Special notes for your reviewer:

No new helpers or types were introduced — the fix reuses commentBodyToString and extractADFText, which already handle the dual plain-string/ADF shape that Jira emits for both comment bodies and descriptions.

Does this PR introduce a user-facing change?

Fix Jira source so the `{{.Body}}` template variable is populated from the issue description instead of always being empty.

Summary by cubic

Fixes Jira source so {{.Body}} is populated from the issue description instead of being empty in Jira-based templates. Handles both Jira Cloud ADF and Data Center string formats.

  • Bug Fixes
    • Request description in Jira search fields.
    • Add Description interface{} to jiraIssueFields to support string and ADF.
    • Set WorkItem.Body in Discover via commentBodyToString.
    • Add tests for string, ADF, and missing descriptions; verify fields includes description.

Written for commit f74b903. Summary will update on new commits.

The Jira source was not fetching the issue description from the API,
causing the documented `{{.Body}}` template variable to silently
evaluate to an empty string for all Jira-based prompt templates.

Add `description` to the fields query parameter, extend
`jiraIssueFields` with a `Description` field (typed as `interface{}`
so it handles both Jira Data Center/Server plain strings and Jira
Cloud Atlassian Document Format objects), and populate
`WorkItem.Body` via the existing `commentBodyToString` helper.

Covered by a new test that exercises both a plain-string description
and an ADF description, plus the missing-description case.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions github-actions Bot added needs-triage kind/bug Categorizes issue or PR as related to a bug needs-kind Indicates an issue or PR lacks a kind/* label needs-priority needs-actor release-note and removed needs-kind Indicates an issue or PR lacks a kind/* label labels Apr 16, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

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.

Bug: Jira source {{.Body}} always empty — description field not fetched from API

1 participant