Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a hyperlink to a Jira issue in Confluence page using python

Manuel Ballester Forner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 18, 2021

Hello, I have been using python to extract the URL links of some issues in a Jira project and after I tried to paste those URL links in the Confluence page. I managed to write them in the page but there is no hyperlink that directly directs you to the Jira issue, they are just wrote as a normal URL so you have to copy and paste them instead. Nevertheless, if I edit the page and I copy and paste all the page content as plain text, the links are now working. 

After using the code I have something similar to this: 

image.png

And I would like to get this:

image.png 

In the python script I am creating a string variable ("saved_links") which contains all the URL links and later, in order to create the Confluence page I am using this commands: 

image.png

I would be very grateful if anyone can help me with this. 

Thanks

1 answer

0 votes
Dominic Lagger
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.
August 19, 2021

Hi @Manuel Ballester Forner 

I do not have Jira linked in my confluence cloud, but it should be the same for confluence internal links.

When you paste the jira link in confluence, then this "button" appears. Then you can check the "storage format". This looks like this:

<p><ac:link ac:card-appearance="inline"><ri:page ri:content-title="TITLE" ri:version-at-save="3" /><ac:link-body>Labels</ac:link-body></ac:link> </p>

You can use this in your body, then the page should be interpreted correctly.

Hope this helps.

Regards, Dominic

Manuel Ballester Forner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 22, 2021

Hello @Dominic Lagger

I cannot see the storage format because probably I do not have permissions for it, is there any other way to do it? 

When you refer to "use it in my body" you mean putting this part in the body of the page while editing? I tried this and still not working...

Thanks in advance,

Manuel

Dominic Lagger
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.
August 23, 2021

Hey Manuel

Yes, if you do not see the storage format, then you do not have permissions.

Here is a example of the jira macro from confluence server:

<ac:structured-macro ac:name="jira" ac:schema-version="1" ac:macro-id="9ebd88e7-0ea1-4490-9562-62bbea256e29"><ac:parameter ac:name="server">Jira</ac:parameter>
<ac:parameter ac:name="columnIds">issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution</ac:parameter>
<ac:parameter ac:name="columns">key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter>
<ac:parameter ac:name="serverId">ff94f833-c264-3d1f-a236-7bdb5d13106c</ac:parameter>
<ac:parameter ac:name="key">JIRA-KEY</ac:parameter></ac:structured-macro>

 Put this with your "JIRA-KEY" in your user macro and try it out.

Regards, Dominic

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events