Automatically link the URL of a Confluence page to a Jira issue and vice versa.
Asked by Schuuudi:

Hi there,

I have created an automation where I automatically create a Confluence page from a newly created Jira issue. Now I want to automatically link the Confluence URL in the Jira ticket using 'Link Confluence Page.' Afterwards, I also want the Confluence page to be automatically linked to the Jira ticket.

I am not a developer, and I have spent hours researching how to implement my idea using the 'Send web requests' automation -- unfortunately, without success. Can someone give me an advice?

Thanks in advance :-)


Answers:
author: Abel A
body: Hi,

I used this endpoint. [https://yoursite.atlassian.net/rest/confluenceIssueLink/1/confluence?issueId={{issue.id}}\&pageUrl={{createdPage.url](https://yoursite.atlassian.net/rest/confluenceIssueLink/1/confluence?issueId={{issue.id}}&pageUrl={{createdPage.url)}}. Takes some time (2\~10 minutes) for cloud to index the link. The link is created right away but based on my experience it does not open right away. ![Link Confluence from Jira Automation.png](https://community.atlassian.com/t5/image/serverpage/image-id/339474iC217F1D8448447DB/image-size/large?v=v2&px=999 "Link Confluence from Jira Automation.png")

comments: author: Hans Polder
body: It would be so cool if this works! I was trying it as well with the webrequest but for the life of me I couldn't figure out what to do with just the {{createdPage.url}} as output.

If your experience is that the URL might not work right away, in Cloud there is since very recently a 'Delay' option added, which would help avoid issues:

![Screenshot 2024-08-01 172442.png](https://community.atlassian.com/t5/image/serverpage/image-id/339485i372774C1FFF7945A/image-size/large?v=v2&px=999 "Screenshot 2024-08-01 172442.png")


author: Schuuudi
body: Good morning and thank you so much for your reply!

I am still testing it - so far without success with or without delay. . .

[@Abel A](/t5/user/viewprofilepage/user-id/4578684) How can I imagine the result of this query? What should I see where, once it's successful?


author: Abel A
body: Hi [@Schuuudi](/t5/user/viewprofilepage/user-id/4338662) ,

In your automation audit log, it will say "Successfully published web request".


author: Lisa Forstberg
body: Hi [@Schuuudi](/t5/user/viewprofilepage/user-id/4338662) ,

Yep, it seems like the automation is still limited in this area. I would love to see some movement on the jira\<\>confluence automations as I have a similar need for Post Incident Reviews in my current assignment.

Some workarounds have been suggested:

* Creating a URL custom field in Jira and sticking the Page URL in this field instead of the standard linking behaviour - see [here](https://community.atlassian.com/t5/Automation-questions/Linking-Confluence-Page-created-by-Jira-Automation/qaq-p/2074609#M4369)
* Sending a webrequest (not accepted answer though) - see [here](https://community.atlassian.com/t5/Jira-questions/How-can-I-automatically-link-a-created-confluence-page-to/qaq-p/2310731)

best regards

/L

comments: author: Schuuudi
body: Hi [@Lisa Forstberg](/t5/user/viewprofilepage/user-id/5101516)

I appreciate the confirmation that there are obviously still gaps here - that doesn't make me feel quite so stupid ;-)

I have already read a few posts on this and will now follow up on your last tip.  
Thank you :-)


Tags: cloud

jira-cloud