Converts Markdown to Atlassian Document Format (ADF).
ConvertTo-AtlassianDocumentFormat [-Markdown] <String> [<CommonParameters>]
Jira Cloud API v3 requires description, comments, and similar text fields to be submitted as ADF JSON objects. This function parses a Markdown string and produces the corresponding ADF structure.
Supported Markdown constructs:
$adf = ConvertTo-AtlassianDocumentFormat -Markdown "**Hello** world"
$body = @{ body = $adf } | ConvertTo-Json -Depth 20
Invoke-JiraMethod -Uri "$server/rest/api/3/issue/TEST-1/comment" -Method Post -Body $body
Converts a Markdown string to ADF and posts it as a comment via the Jira Cloud v3 API.
$description = @"
# Release Notes
* Bug fix for login
* New dashboard widget
"@ | ConvertTo-AtlassianDocumentFormat
$body = @{ fields = @{ description = $description } } | ConvertTo-Json -Depth 20
Invoke-JiraMethod -Uri "$server/rest/api/3/issue/TEST-1" -Method Put -Body $body
Updates an issue description on Jira Cloud using Markdown converted to ADF.
$adf = ConvertTo-AtlassianDocumentFormat -Markdown "**Hello** world"
$adf | ConvertTo-Json -Depth 20
Inspects the ADF structure generated from a simple Markdown string.
The Markdown string to convert to ADF.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
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).
A Markdown-formatted string.
An ADF document as a hashtable with version, type, and content keys,
ready to be serialized to JSON with ConvertTo-Json -Depth 20.
The output must be serialized with sufficient depth (-Depth 20 or higher)
to preserve the nested ADF structure.
This function is public because JiraPS’s write commands (New-JiraIssue, Set-JiraIssue,
Add-JiraIssueComment) currently use API v2, which accepts plain text or wiki markup.
Users who need to write to Jira Cloud v3 endpoints via Invoke-JiraMethod must supply ADF.
Making this function public lets users convert Markdown to ADF for those calls without
reimplementing the logic.
Alias: ConvertTo-ADF