Using Confluence Cloud v2 REST API to create a page with the JIRA issues macro

I have the url of a JIRA issue that want to add to the JIRA issues in my confluence page.

What is the format of the “body” data?

Thank you in advance for the response.

Welcome to the Atlassian Developer Community, @IanReid!

If you want to create a page with just the link that will end up looking like this

Then you request body will look something like

{
    "title": "Jira macro test via API with a single issue link ITSM-1",
    "status": "CURRENT",
    "body":
    {
        "value": "<p><ac:structured-macro ac:name=\"jira\" ac:schema-version=\"1\" ac:macro-id=\"2b22ee11-f71a-43de-8d29-fa42a2a1735e\"><ac:parameter ac:name=\"key\">ITSM-1</ac:parameter></ac:structured-macro> </p>",
        "representation": "STORAGE"
    },
    "spaceId":  {spaceId}
}

If what you are thinking of is adding an issue to the Jira macro like this

then the request body will look something like this

{
    "title": "Jira macro test via API to add a single issue (TEST-1) in the Jira macro",
    "status": "CURRENT",
    "body":
    {
        "value": "<ac:structured-macro ac:name=\"jira\" ac:schema-version=\"1\" data-layout=\"full-width\"  ac:macro-id=\"9f990f36-e473-461c-9c08-2c9b685a5576\"><ac:parameter ac:name=\"columns\">key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name=\"maximumIssues\">20</ac:parameter><ac:parameter ac:name=\"jqlQuery\">issue = TEST-1 </ac:parameter></ac:structured-macro>",
        "representation": "STORAGE"
    },
    "spaceId": {spaceId}
}

In this 2nd approach, since the Jira macro works with JQLs, you only need the issue key of the issue you want to add and update the jqlQuery parameter. If you want to add more issues in the macro, simply update the JQL to get more results.

Hope this helps.
Ian

Thanks for the fast response.
What are the consequences of omitting the macro_id and/or schema-version parameters?