fix(jira): Populate WorkItem.Body from issue description#1000
Open
kelos-bot[bot] wants to merge 1 commit intomainfrom
Open
fix(jira): Populate WorkItem.Body from issue description#1000kelos-bot[bot] wants to merge 1 commit intomainfrom
kelos-bot[bot] wants to merge 1 commit intomainfrom
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 bothdocs/integration.mdand the official example use it.This PR:
descriptionto thefieldsquery parameter sent to the Jira search API so the description is actually returned.jiraIssueFieldswith aDescription 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.WorkItem.BodyinDiscoverusing the existingcommentBodyToStringhelper, which already handles both shapes.TestJiraDiscoverDescriptiontest 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
commentBodyToStringandextractADFText, 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?
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.descriptionin Jira searchfields.Description interface{}tojiraIssueFieldsto support string and ADF.WorkItem.BodyinDiscoverviacommentBodyToString.fieldsincludesdescription.Written for commit f74b903. Summary will update on new commits.