Is it possible to change the number of Issue Links that display by default?

Andy Cleff May 24, 2012

Currently in a JIRA ticket that has Isue Links - the default is to show the first 5 links followed by a "Show x more links..." which will expand the Issue Links display to show all links.

Is it possibile to either force the default to display all issue links or to change the default to show 10 links?

4 answers

1 accepted

4 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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.
July 23, 2012

It is hard coded in LinkBlockContextProvider class.

private static final int DEFAULT_DISPLAYED_LINK_COUNT = 5;

You ca override it in the linkblock.vm in the jira-view-issue-plugin, which is a bundled plugin. Some tips on editing a bundled plugin can be found in this post.

http://www.j-tricks.com/1/post/2012/05/modifying-atlassian-bundled-plugins.html

ArtemB July 24, 2012

Wow, thanks a lot Jobin!

I've found the code, but there is no such a line in linkblock.vm.

I'm not sure what to change in the code, could you please suggest?

http://dl.dropbox.com/u/27118118/linkblock.vm

Jobin Kuruvilla [Adaptavist]
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.
July 24, 2012

Totally *Untested* suggestion. Put the following line after the first #set statment.

#set ($modifiedDisplayedLinkCount = 10)

And then replace all uses of $displayedLinkCount with $modifiedDisplayedLinkCount

ArtemB July 24, 2012

Yooohoo! Incredible, it works :) Thank you so much!

The only issue is that amount of clones left as hidden (in braces) is not displayed correctly. Attached a screenshot.

I have no idea where to find and fix it. Maybe you know where to fix this thingy?

explanation

Jobin Kuruvilla [Adaptavist]
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.
July 24, 2012

That goes again to the action class. You might be better of removing that. Remove this:

<span>($hiddenLinkStats)</span>

The count is there in the link anyways!

ArtemB July 24, 2012

Thank you very much Jobin!

Pablo Beltran
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.
June 5, 2014

Modifiying the JIRA source code might become a real headache making harder upgrade to newer versions.

On the other hand, the Links Hiearchy add-on shows all the linked issues at a glance without requiring you to modify any source code. By default, it expands the first depth level but users can configure it to auto expand n-levels automatically.

UB May 16, 2017

> It is hard coded in LinkBlockContextProvider class.

 

latest.png

Like Support IVèS likes this
1 vote
Matthias Kahlert August 29, 2018

Another workaround for that:

If you are using Google Chrome Browser, install the StyleBot plugin, and add a rule for your JIRA installation:

dd.collapsed-link {
display: block;
}

This always displays ALL links, no more limits...

Vadim Ippolitov August 13, 2020

Thank you! Additionally I added this to hide the "expander" button:

div#show-more-links {
display: none;
}
1 vote
Ramiro Pointis
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.
May 24, 2012

Hi Andy,

I'm sure it can't be changed inside Jira. Maybe you will need to a little code change in the Jira files. Not sure if it's worth the trouble.

ArtemB July 23, 2012

Hi Ramiro,

In our case we really need to increase the amount of links shown there. We need at least 12...

I spent a couple of hours digging the code of Jira and didn't find any suitable info.

Do you know where to search for it?

Thanks for any help in advance.

0 votes
ArtemB July 24, 2012

Thank you very much Jobin!

Suggest an answer

Log in or Sign up to answer