Hi, I also had the needs to add some coulmn information in the issue links table in Jira 4.4.5. I found the way changing the "jira-view-issue-plugin" in the Jira source code.
I changed the following files in the plugin: "LinkBlockContextProvider.java" and "linkblock.vm"
For example if you want to add the assignee column you need to add in the "class SimpleLinkedIssue" the following code in the file "LinkBlockContextProvider.java":
public String getAssignee() { return linkedIssue.getAssigneeUser().getDisplayName(); }
and in the "linkblock.vm" :
<td class="assignee"> ${linkIssue.assignee} </td>
in the <tr> after "#foreach (${linkIssue} in ${linkedIssues})" code
Hi,
Following the idea of :
And the idea this question, I have created an script to be included in the JIRA banner to add the fixversion in the issue link section, but just for specific projects and specific links.
<link type="text/css" rel="stylesheet" href="/s/db3b6a62696fa11def130a371ef1a39f-CDN/en_USoe5giz/64016/96/7df3cf06a8aa5b431658f0bcaee3999a/_/download/contextbatch/css/jira.navigator.simple,jira.navigator.advanced,jira.view.issue,atl.general,jira.navigator.kickass,jira.global,jira.general/batch.css?jag_disabled_marketing=true&user-logged-in=true&hc-enabled=true" media="all">
<script type='text/javascript'>
AJS.$(document).ready(function()
{
var objPageHeader = AJS.$(document).find('div.aui-page-header-main');
var myIssueKey = "";
if (objPageHeader.length) { myIssueKey = AJS.$(objPageHeader).find('a.issue-link').attr("data-issue-key"); }
//window.alert("my-issue-key: " + myIssueKey);
AJS.$('dl.links-list dd').each(function()
{
var objDD = this;
var objIssueLink = AJS.$(objDD).find('a');
var linkedIssueKey = "";
if (objIssueLink.length) {
linkedIssueKey = AJS.$(objIssueLink).attr("data-issue-key");
//window.alert("linked-issue-key: " + linkedIssueKey);
}
if ( myIssueKey.startsWith("LDMSD") && ( linkedIssueKey.startsWith("DMP") || linkedIssueKey.startsWith("LBL") ) )
{
//window.alert("linked-issue-key: " + linkedIssueKey);
AJS.$.getJSON(AJS.contextPath() + '/rest/api/latest/issue/' + linkedIssueKey, function(data)
{
var objSpan = AJS.$(objDD).find('span.link-summary');
if (objSpan.length) {
var value = data.fields.fixVersions.map(function(version){return version.name});
if (value != "")
{
AJS.$(objSpan).after('<span><b> (' + value + ')</b></span>');
}
}
});
}
});
});
</script>
In this way, in my case, I can see the fixversion of the linked issues, but just only for the tickets started with LDMSD and only for tickets started with DMP and LBL.
hope this hepls!
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Solution is working fine, But, after any change in the page like adding comment, inline editing of fix version , adding or deleting issue link the assignee name or the added column name disappears .
Any solution for this ?
Regards,
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I am happy to announce that with our recently released Issue Matrix plug-in, changes to the visualization of sub-tasks or linked issues can be done very easily with out custom code or scripting. The changes are also configurable per issue type or project.
In a nutshell Issue Matrix will help displaying not just system fields but any custom field for sub-tasks or linked issues. See more on its functionality here: https://botronsoft.atlassian.net/wiki/display/ILV/Concept and let us know in case you need any support. The attachment shows example how linked issue panel can be improved using Issue Matrix.
Thanks,
Peter T
Linked-Big.jpg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I did the same for version 5.2.11. It's more complex of the patch in version 4.4.
The plugin to modify is the same "jira-view-issue-plugin" under "atlassian-jira-5.2.11-source/jira-project/jira-components/jira-plugins" path (hope is the same in v.5.2.2).
The files I modified are:
linkblock.vm:
I add this code after "#if ($hasIssueLinks)" line to have the column name above the list
of issues (to better understand the added column values); you can avoid if you don't need:
<dl class="links-list "> <dt title="is related to"></dt> <dd><div class="link-content"> <table width="100%" class="link-summary" > <tr class="link-summary"> <th width="15%" align="center" class="link-summary"> <span title="Key">Key</span> </th> <th width="40%" align="center" class="link-summary"> <span title="Summary">Summary</span> </th> <th width="15%" align="center" class="link-summary"> <span title="Assignee">Assignee</span> </th> <th width="15%" align="center" class="link-summary"> <span title="Status">Status</span> </th> <th width="15%" align="center" class="link-summary"> <span title="icons">&nbsp;&nbsp;&nbsp;&nbsp;</span> </th> </tr> </table> </div></dd> </dl>
localissuelink.vm:
I change this file with a new table to show all column's value; I add this code after the line "#set($contextMap = ${issueLinkContext.map})" :
<table width="100%" > <tr class="link-title#if (${contextMap.resolved}) resolution#end" width="15%"> <td> <span title="Key"> #macro (renderIcon $url $title $alt) #if ($url) <img src="$url" width="16" height="16" title="$!{title}" alt="$!{alt}" /> #end #end #set($contextMap = ${issueLinkContext.map}) <p> #renderIcon(${contextMap.iconUrl} ${contextMap.iconTooltip} ${contextMap.iconTooltip}) <span title="${contextMap.tooltip}"> <a href="${contextMap.url}" class="link-title#if (${contextMap.resolved}) resolution#end">${contextMap.title}</a> </span> </p> </span> </td> <td width="40%"> <span class="link-summary">$!{contextMap.summary}</span> </td> <td width="15%"> <span class="link-summary">${contextMap.linkIssueAssignee}</span> </td> <td width="15%"> <span class="link-summary">${contextMap.linkIssueStatus}</span> </td> <td width="15%"> #if (${contextMap.priorityIconUrl} || ${contextMap.statusIconUrl}) <ul class="link-snapshot"> #if (${contextMap.priorityIconUrl}) <li class="priority">#renderIcon(${contextMap.priorityIconUrl} ${contextMap.priorityIconTooltip} ${contextMap.priorityIconTooltip})</li> #end #if (${contextMap.statusIconUrl}) #if (${contextMap.statusIconLink}) <li class="status"><a href="${contextMap.statusIconLink}">#renderIcon(${contextMap.statusIconUrl} ${contextMap.statusIconTooltip} ${contextMap.statusIconTooltip}) </a></li> #else <li class="status">#renderIcon(${contextMap.statusIconUrl} ${contextMap.statusIconTooltip} ${contextMap.statusIconTooltip})</li> #end #end </ul> #end </td> </tr> </table>
Note: change the "width" of the column to fit the content.
LocalIssueLinkUtils.java:
In this file add tha values of our new columns, in the "getLocalIssueLinkVelocityContext" method:
putMap(contextBuilder, "linkIssueProject", (linkedIssue.getProjectObject()!=null?linkedIssue.getProjectObject().getKey():"")); putMap(contextBuilder, "linkIssueAssignee", ((linkedIssue != null && linkedIssue.getAssigneeUser()!=null)?linkedIssue.getAssigneeUser().getDisplayName():"")); putMap(contextBuilder, "linkIssueStatus", (linkedIssue.getStatusObject()!= null?linkedIssue.getStatusObject().getName():""));
I hope that it helps :)
BR
Massimo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Massimo
I checked in JIRA 6.2 to add this code, files are different now, and in different location, do you think above change will work in JIRA 6.2 also, can u please confirm, thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Massimo, many thanks for posting this modification. This has been very useful.
I've got it working for components in v6.2.7 in the following way (I didn't go for adding a table with a header). Also if anyone can improve my code, please do, I'm still learning.
\jira-project\jira-components\jira-plugins\jira-view-issue-plugin\src\main\java\com\atlassian\jira\plugin\viewissue\issuelink\LocalIssueLinkUtils.java
Added to top
import java.util.Collection; import java.util.Iterator; import com.atlassian.jira.bc.project.component.ProjectComponent;
Added after tooltip putmap line
if (linkedIssue.getComponentObjects() != null) //Added by SRK { Collection colComponents = linkedIssue.getComponentObjects(); Iterator<ProjectComponent> compIter = colComponents.iterator(); String compList = ""; while(compIter.hasNext()){ ProjectComponent component = (ProjectComponent)compIter.next(); if (compList == "") { compList = component.getName(); } else { compList = compList + ", " + component.getName(); } } putMap(contextBuilder, "component", compList); }
\jira-project\jira-components\jira-plugins\jira-view-issue-plugin\src\main\resources\issuelink\localissuelink.vm
Added below summary paragraph
<p> <span class="link-summary">$!{contextMap.component}</span> </p>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dalectric, thank you very much! I'll need your post next year when I'll upgrade the server to Jira 6.x
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know this is an old question, but we are running version 5.2.2 and want to add the issue's Fix Version as a column. Is this possible in this version of Jira?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Had a look at the code, I guess it is pretty much restricted about what you can do for this. Even though there are two velocity templates that are used for the rendering, the context that is passed seems to be limited. Sorry, nothing much possible, AFAIK :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Read this thread, looks to be similar to what you need https://answers.atlassian.com/questions/33294/jira-issue-link-to-show-assignee-also
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Renjith, the suggested steps in the link does not seem to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I was looking for the exact same functionality. Want the priority to be shown in a subtask list and thus wants to add that column. Is this something that you are considering for future releases? Br Lone Lauritsen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not possible in JIRA up to version 5.0, as far as I know
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible in newer versions of JIRA?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.