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!
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&tempMax=10"/>
</ac:parameter>
</ac:structured-macro>
Refer this helpful article.
I have tried this API, where i want filter only the status of the ticket, but defaults its showing the key and summary.
any way to exclude the key, summary and just to display the status
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can configure only the status column in the macro's markup to see if it functions correctly.
Change from
<ac:parameter ac:name="columns">type;key;summary</ac:parameter>
to
<ac:parameter ac:name="columns">status</ac:parameter>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.