Is it possible to add 'Jira Issue' macro into Confluence page via REST API or atlassian-python-api?

Astesia August 4, 2021

Hi there! We would like to create some confluence pages with 'Jira Issue' macro to summarize some results of our work. We found the way to add macros via editor on confluence page. However, to accelerate and automate the process, we would like this process also to be done via API. 

Just like to create a new confluence page via API, where we only need to post json data with page title and page content etc to our server, we imagine there should also be an API that we could post json data with information about Jira Issue macro to our confluence server, and the Jira macro could then be added into the page content. However, we failed to find any this kind of functional API in documentations

Besides, we also tried another possible way: to add a Jira Issue macro via editor into a page, record the json data corresponding to this part, and post it to a new page. However, the same Jira Issue macro didn't appear on the new page.

Therefore, we would really sincerely like to know how we could achieve this. Thank you for your help! 

1 answer

1 vote
Kishan Sharma
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 6, 2021

Hi @Astesia Welcome to the community :)

For inserting jiraissues macro through REST API in confluence pages, the markup should be sent with the content body. Example of how the markup for the jiraissues macro looks like from atlassian document:
https://confluence.atlassian.com/conf59/jira-issues-macro-792499129.html

<ac:structured-macro ac:name="jiraissues">
<ac:parameter ac:name="anonymous">true</ac:parameter>
<ac:parameter ac:name="columns">type;key;summary</ac:parameter>
<ac:parameter ac:name="url">
<ri:url ri:value="http://jira.atlassian.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+CONF+AND+%28summary+%7E+jiraissues+OR+description+%7E+jiraissues+OR+comment+%7E+jiraissues%29&amp;tempMax=10"/>
</ac:parameter>
</ac:structured-macro>

Refer this helpful article.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events