Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Example of valid PUT/POST request for inserting a JIRA issue filter macro on a WIKI page?

admin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 24, 2021

Hi guys,

Please can you provide one valid example of a PUT/POST request for inserting the jira issue filter on a wiki page.

I can create/update wiki pages using POST/POST request without any issue as long as it contains free text. 

As soon as I try to insert a MACRO in my PUT/POST request, I get a 500 (internal server error).

Below you can find the example of one such request that I make:

curl --proxy <my server proxy> -u <username>:<password> --request PUT \
--url 'https://wiki.swisscom.com/rest/api/content/<page id>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": {
"number": 9
},
"title": "Test Draft",
"type": "page",
"status": "current",
"ancestors": [
{
"id": "<ancestor page id>"
}
],
"body": {
"storage": {
"value": "<p>Hello World!</p><p>This is a test page being created.</p><p>Lets see how this works.</p><p><ac:structured-macro ac:name=\"jira\"><ac:parameter ac:name=\"columns\">key,summary,type,created,assignee,status</ac:parameter><ac:parameter ac:name=\"server\">Swisscom JIRA</ac:parameter><ac:parameter ac:name="serverId">the server id I received on a GET request from a manually inserted macro</ac:parameter><ac:parameter ac:name=\"jqlQuery\">DAC-34371</ac:parameter> </ac:structured-macro></p>",
"representation": "storage"
}
}
}'

 

Note:

 

1. If I just do the following request (without macro) everything works as expected:

curl --proxy <my server proxy> -u <username>:<password> --request PUT \
--url 'https://wiki.swisscom.com/rest/api/content/<page id>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": {
"number": 9
},
"title": "Test Draft",
"type": "page",
"status": "current",
"ancestors": [
{
"id": "<ancestor page id>"
}
],
"body": {
"storage": {
"value": "<p>Hello World!</p><p>This is a test page being created.</p><p>Lets see how this works.</p>",
"representation": "storage"
}
}
}'

 

2. Also. that is the case with any macro that I want to insert

Therefore, I feel there is some parameter which is not being interpreted correctly in the macro request body.

Please can you help?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events