I am trying to update my hyperlink with jira issue .but it shows [Link Text|URL] instead of an actual hyperlink.
my code
const commentBody = `Testing comment.For more details, check out [Click here|https://identifyyou.atlassian.net/browse/TEST-1]`;
var commentData = {
"body": {
"content": [
{
"content": [
{
"text": commentBody,
"type": "text"
}
],
"type": "paragraph"
}
],
"type": "doc",
"version": 1
}
};
try {
const response = await api.asApp().requestJira(route`/rest/api/3/issue/10206/comment`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(commentData)
});
const responseBody = await response.text();
// console.log('Raw response body:', responseBody);
if (response.ok) {
const data = JSON.parse(responseBody);
console.log('Comment successfully added:', data);
} else {
console.error('Failed to add comment, status code:', response.status, 'response:', responseBody);
}
} catch (error) {
console.error('Error adding comment:', error);
}