From c4c7e3f38618e8321d5d03ed865975cdce39facf Mon Sep 17 00:00:00 2001 From: Amanda Bizzinotto Date: Mon, 26 Jun 2023 19:51:11 -0300 Subject: [PATCH] Add rich text example to docs (#1681) --- docs/examples.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/examples.rst b/docs/examples.rst index ce8afb4e6..d4e6e1cfa 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -264,6 +264,29 @@ Updating components:: existingComponents.append({"name" : component.name}) issue.update(fields={"components": existingComponents}) +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):: + + jira = JIRA(basic_auth=("email", "API token")) + comment = { + "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" + } + ] + } + ] + } + jira.add_comment("AB-123", comment) Fields ------