Skip to content

Issue description support of Atlassian Document Format (ADF) #1841

Description

@cacack

Bug summary

Per the documentation https://jira.readthedocs.io/examples.html#working-with-rich-text

You can use rich text in an issue’s description or comment. In order to use rich text, the body content needs to be formatted using the Atlassian Document Format (ADF)

However, passing in a dictionary for the description field on an issue throws a error indicating the description must be a string. The source does type this as a string https://github.com/pycontribs/jira/blob/main/jira/resources.py#L761, so I suspect the documentation is incorrect and ADF can't (currently) be used for descriptions. If so, then would like to raise this as a bug to have ADF correctly supported for descriptions.

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Cloud (Hosted by Atlassian)

Jira instance version

No response

jira-python version

3.6.0

Python Interpreter version

3.11.4

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

# 1. Given a Jira client instance
jira: JIRA
# 2. And given dictionary containing the ADF

rich_text = {
    "type": "doc",
    "version": 1,
    "content": [
      {
        "type": "codeBlock",
        "content": [
          {
            "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
            "type": "text"
          }
        ]
      }
    ]
  }

# 3. And given a dictionary contain the issue contents using the rich_text above.

issue_contents = {
    "project": {"id": "12345"},
    "issuetype": {"name": "Story"},
    "summary": "This is a test",
    "description": rich_text,
}

# 2. When I call the function using the issue_contents dictionary above.
issue = jira.create_issue(fields=issue_contents)

# 3. The JIRAError exception is thrown:
response text = {"errorMessages":[],"errors":{"description":"Operation value must be a string"}}

Stack trace

response text = {"errorMessages":[],"errors":{"description":"Operation value must be a string"}}

Expected behaviour

The issue is created using the ADF specified for the description.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions