Converts an Atlassian Document Format (ADF) object to Markdown.
ConvertFrom-AtlassianDocumentFormat [[-InputObject] <Object>] [<CommonParameters>]
Jira Cloud API v3 returns description, comments, and many custom fields as ADF JSON objects. This function converts ADF to Markdown, preserving headings, bold, italic, strikethrough, inline code, links, bullet/ordered/task lists, tables, code blocks, blockquotes, mentions, emoji, and dates.
Plain strings (Data Center / API v2) are returned unchanged.
$raw = Invoke-JiraMethod -Uri "$server/rest/api/3/issue/TEST-1" -Method Get
$markdown = ConvertFrom-AtlassianDocumentFormat -InputObject $raw.fields.description
Converts the ADF description returned by the Jira Cloud v3 API into readable Markdown.
$raw.fields.description | ConvertFrom-AtlassianDocumentFormat
The same conversion using pipeline input.
$comments = Invoke-JiraMethod -Uri "$server/rest/api/3/issue/TEST-1/comment" -Method Get
$comments.comments | ForEach-Object {
ConvertFrom-AtlassianDocumentFormat -InputObject $_.body
}
Converts each ADF comment body to Markdown.
The ADF object (PSCustomObject with type = “doc”) or a plain string. When a plain string is provided it is returned unchanged, making the function safe to use regardless of whether the server returns ADF or wiki markup.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
An ADF document object (PSCustomObject or hashtable) or a plain string.
A Markdown representation of the ADF input, or the original string if the input was not ADF.
This function is public because JiraPS’s read commands (Get-JiraIssue, Get-JiraIssueComment)
only convert ADF automatically when they use API v3 internally. Users who call Invoke-JiraMethod
directly against Jira Cloud v3 endpoints receive raw ADF objects that need manual conversion.
Making this function public lets users convert those responses to Markdown without reimplementing
the logic.
It is also useful for inspecting the raw ADF structure returned by the API alongside the converted Markdown output.
Alias: ConvertFrom-ADF