Links to each other on the Confluence pages

I created the special template for Use Case creation in Confluence. And I'd like to link pages between themselves. Is there some way to link pages like Jira (or other bug-trackers)? When I insert the link on the 1st page, reverse link is created too on the second page. I'd like to create a custom field fot this in my template

1 answer

1 accepted

You can do this pretty easy with a user macro. Here is what it would look like.

Macro name:
referring_content

Macro title:
Referring Content

Macro Body Processing:
No maco body

Template:

## Developed by: Davin Studer
## Date created: 06/26/2014
## @noparams

#set($containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager=$getInstanceMethod.invoke(null,null))
#set($containerContext=$containerManager.containerContext)
#set($linkManager=$containerContext.getComponent('linkManager'))

#set($pages = $linkManager.getReferringContent($content))

#foreach($page in $pages)
    <a href="$page.getUrlPath()">$page.getTitle()</a><br/>
#end

 

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

830 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you