Jira Issue links in Confluence page

Jesús Jorge Muñoz March 19, 2018

Hello everyone,

I am trying to retrieve the jira issues linked in a Confluence page by using REST API, but it seems not possible.

When I try the following URLs:

/rest/api/content/{pageId}

/rest/api/content/{pageId}/property

/rest/api/content/{pageId}?expand=metadata

/rest/api/content/{pageId}?expand=body

It doesn't appear anywhere any related info with Jira issue links a Confluence page has. Is that even possible? Because I've searched in REST API docs and didn't find anything related to it.

Thanks in advance,

Jesús

2 answers

1 vote
ManuR
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2018

Hello Jesús,

 

You can achieve this using {{/rest/api/content/{pageId}?expand=body}} by adding the storage component at the end so your URL will look like this:

/rest/api/content/{pageId}?expand=body.storage

This will give you the storage format of your page where you will be able to see your Jira issue macros.

They have the following format:

<ac:structured-macro ac:name="jira" ac:schema-version="1">

Cheers,
Manu

Jesús Jorge Muñoz April 18, 2018

Hello Emmanuel,

Thanks for your reply.

The solution you provided works well if I add a Jira macro to my page. However, that's not necessary if we want to have a Jira issue linked to a Confluence page.

If we link a issue to a page from Jira, no macro is added to a page and both are linked as well. Several pages of my Confluence instance are linked with this method.

Anyway, thanks for your solution! I hope it could be useful for someone.

Kind regards,

Jesús

Like Gianluca likes this
Gianluca November 27, 2018

Hi Jesús,

 

Did you find any solution? Same problem here. 

 

Kind regards,

Gianluca

Like Giacomo Esposito likes this
Jesús Jorge Muñoz December 11, 2018

Hi @Gianluca,

I'm afraid there is no suitable solution using REST API in Cloud version, at least from my experience's point of view. 

The only way I could get these info was writing a Node.js script that polls remote links from Jira Cloud issue, saving this info in a database/file and reading this database from Confluence macro. 

Keep in mind this workaround was implemented for a very specific use case. I would try to use Jira issue macro instead.

Hope it helps.

Jesús

0 votes
NotTheRealStephenSifersNOPENOPENOPENOPE
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2018
Jesús Jorge Muñoz March 26, 2018

Hi Stephens,

Thanks for your reply. I've checked the two links you provided, but I don't see how they can help me.

I think some important details of my context are missing. I am developing an add-on in Confluence Cloud, using ACE. I need somehow to get this info by making a request to the Confluence Cloud instance.

Since those links are related to Jira Server they can't address this problem.

Sorry for the missing info.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events