Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,550 views 7 30
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you