/
Comment a ticket with line breaks
Comment a ticket with line breaks
Problem description, when posting a text containing line breaks like below
"description": "Test incident\n\n\nCreated by: Peter Atthem\npeter@rixter.se\n\nImpact: 2 - Medium\nUrgency: 2 - Medium\nPriority: 3 - Moderate",
the request to Jira will fail due to the line breaks. Since it resolves like this
"text": "Test incident
Created by: Peter Atthem
peter@rixter.se
Impact: 2 - Medium
Urgency: 2 - Medium
Priority: 3 - Moderate",
"type": "text"
To solve this use {{{toJSON description}}}
to substitute the variable, this will covert the input to safe json string
Add a action with the following details
Method: POST
URL: https://{{baseUrl}}/rest/api/3/issue/{{issueKey}}/comment
Authorization: Atlassian Authorization token
Body:
{
"body": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": {{{toJSON description}}},
"type": "text"
}
]
}
]
}
}
, multiple selections available,
Related content
Http Rule Response
Http Rule Response
More like this
Incoming Webhooks example
Incoming Webhooks example
More like this
Converting HTML to Wikimarkup
Converting HTML to Wikimarkup
More like this
Splunk
Splunk
More like this
Comment Issue
Comment Issue
More like this
Append severity to a comment when changed
Append severity to a comment when changed
More like this