Hello!,
I need to know if it is possible via rest api to show an attachment on a confluence page as if it were a kind of hyperlink, with a custom text.
I'm trying to do this but it doesn't work for me:
node {
stage("Create hyperlink to attachment"){
sh """
curl -s -D- -H "Authorization: Basic XXXXXXXXXX:XXXXXXXXXXXX" -X PUT -H 'Content-Type: application/json' -d'{
"id": "84652952",
"type": "page",
"status": "current",
"title": "Prueba-Jenkins",
"body": {
"storage": {
"value":
"<ac:link>
<ri:attachment ri:filename="FILENAME.docx"/>
<ac:plain-text-link-body>
<![CDATA[RANDOM COMMENT]]>
</ac:plain-text-link-body>
</ac:link>",
"representation": "storage"
}
}
}' https://XXXXXXXXXXXXXX/confluence/rest/api/content/84652952
"""
}
}
Is this way of working correct?
Thanks in advance,
Adolfo S.