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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published yesterday in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

115 views 2 4
Read article

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