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

2 votes
Accepted answer

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
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,127 views 17 14
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