fix: convert descriptions to ADF format for Jira API v3 - #119
Open
jmservera wants to merge 1 commit into
Open
Conversation
Jira REST API v3 requires the description field to be in Atlassian Document Format (ADF) rather than plain text. This caused HTTP 400 errors when creating issues. Changes: - Add text_to_adf() to convert plain text to ADF JSON structure - Add adf_to_text() to parse ADF back to plain text (with backwards compatibility for plain strings and PropertyHolder objects) - Add format_description() on JiraProject that applies ADF conversion only when api_version is '3' - Fix parse_alert_info() to handle ADF input by converting to text first - Fix failed tuple to return 5 elements (matching the return signature) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Jira integration to be compatible with Jira REST API v3, which requires description to be sent/received in Atlassian Document Format (ADF) rather than plain strings (avoiding HTTP 400s during issue creation and ensuring parsing continues to work).
Changes:
- Added
text_to_adf()to convert plain-text descriptions into an ADF “doc” structure. - Added
adf_to_text()and updatedparse_alert_info()to reliably parse metadata from either ADF or plain-string descriptions. - Introduced
JiraProject.format_description()to apply ADF conversion only whenapi_version == "3", and fixedparse_alert_info()’s failure tuple to match its 5-element return signature.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
@zkoppert could you take a look? I managed to make it work with the new v3 with this change, I'm currently using my fork and works like a charm:
|
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.

Jira REST API v3 requires the description field to be in Atlassian Document Format (ADF) rather than plain text. This caused HTTP 400 errors when creating issues.
Changes: