A comment is a piece of text that can be added to an issue to provide additional information or to update the issue's status. Comments can be added by users who have permission to view and edit the issue, and can be used for a variety of purposes, such as:
Providing context or additional details about an issue.
Sharing progress or updates on the issue's status.
Asking questions or requesting feedback from other team members.
Acknowledging or responding to other comments or feedback.
Notifying other users of relevant information or changes.
Mention your teammates: If you need someone to know about a comment, you can mention them in it. Type @ followed by their name, then choose the right person from the list. The person you mention will be notified about your comment and can quickly jump to the issue to see what's happening.
Apply comment permissions: If your comment is only meant for a specific Jira group or project role, comment permissions let you restrict your comments to the appropriate audience. When writing your comment, click the lock icon under it and choose a Jira group or project role to restrict it to.
The Atlassian Document Format (ADF) represents rich text stored in Atlassian products. For example, in Jira Cloud platform, the text in issue comments and in textarea custom fields is stored as ADF, here's a bundle of examples you can use in order to create custom body messages.
Example 1
commentBody :=jira.CommentNodeScheme{} commentBody.Version =1 commentBody.Type ="doc"//Append Header commentBody.AppendNode(&jira.CommentNodeScheme{ Type: "heading", Attrs: map[string]interface{}{"level": 1}, Content: []*jira.CommentNodeScheme{ { Type: "text", Text: "Header 1", }, }, })//Append Lorem text commentBody.AppendNode(&jira.CommentNodeScheme{ Type: "paragraph", Content: []*jira.CommentNodeScheme{ { Type: "text", Text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore "+"et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip "+"ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore "+"eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui "+"officia deserunt mollit anim id est laborum", }, }, })//Append Nested Panel Data commentBody.AppendNode(&jira.CommentNodeScheme{ Type: "panel", Attrs: map[string]interface{}{"panelType":"note"}, Content: []*jira.CommentNodeScheme{ { Type: "paragraph", Content: []*jira.CommentNodeScheme{ { Type: "text", Text: "Excepteur ", Marks: []*jira.MarkScheme{ {Type: "textColor", Attrs: map[string]interface{}{"color":"#6554c0"}}, }, }, { Type: "text", Text: "sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum", }, }, }, }, })//Append Heading Title commentBody.AppendNode(&jira.CommentNodeScheme{ Type: "heading", Attrs: map[string]interface{}{"level": 2}, Content: []*jira.CommentNodeScheme{ { Type: "text", Text: "Links", }, }, })//Append bulletList commentBody.AppendNode(&jira.CommentNodeScheme{ Type: "bulletList", Content: []*jira.CommentNodeScheme{ { Type: "listItem", Content: []*jira.CommentNodeScheme{ { Type: "paragraph", Content: []*jira.CommentNodeScheme{ { Type: "text", Text: "Google.com", Marks: []*jira.MarkScheme{ { Type: "link", Attrs: map[string]interface{}{"href": "https://www.google.com/"}, }, }, }, }, }, }, }, { Type: "listItem", Content: []*jira.CommentNodeScheme{ { Type: "paragraph", Content: []*jira.CommentNodeScheme{ { Type: "text", Text: "Facebook.com", Marks: []*jira.MarkScheme{ { Type: "link", Attrs: map[string]interface{}{"href": "https://www.facebook.com/"}, }, }, }, }, }, }, }, }, })