JIRA: customize Issue details panel

Ioannis OIKONOMOU February 15, 2012

Hello,

I am using JIRA v4.1.2 and let's say that I have created a custom field "customfield_10370".

I know that by associating this custom field to the "Default Screen" for example, the field will automatically appear in the Issue details panel of every Issue. However I cannot configure the exact position that the field will be displayed on the panel.

Is there some way to do that?

For now, to overcome this problem, I decided to adapt the velocity template "issuesummaryblock.vm" under "C:\Program Files\Atlassian\JIRA 4.1.2\atlassian-jira\WEB-INF\classes\templates\jira\issue\summary", by adding the following block to the position that I want to have the custom field displayed, and without of course associating the custom field to the "Default Screen" anymore:

#set ($fixedversion=$customFieldManager.getCustomFieldObject("customfield_10370"))
#if ($fixedversion.isInScope($issue.getProjectObject(), null))
  #if ($fieldVisibility.isFieldHidden("customfield_10370", $issue) == false)
    <li class="item item-right">
        <div class="wrap">
            <strong class="name">$i18n.getText("$fixedversion.name"):</strong>
            <span id="fixedversion-val" class="value">
                #set ($fixedversionval=$fixedversion.getValue($issue))
                #if ($fixedversionval)
                    <span class="shorten" id="fixedversion-field">
                        #foreach ($v in $fixedversionval)
                            <a href="${baseurl}/secure/IssueNavigator.jspa?reset=true&mode=hide&sorter/order=ASC&sorter/field=priority&pid=${issue.projectObject.key}&customfield_10370=${v.id}" title="$textutils.htmlEncode($v.name) $!textutils.htmlEncode($!v.description)">$textutils.htmlEncode($v.name)</a>#if( $velocityCount < $fixedversionval.size() ),#end
                        #end
                    </span>
                #else
                    $i18n.getText('common.words.none')
                #end
            </span>
        </div>
    </li>
  #end
#end

Thank you,

Ioannis

6 answers

0 votes
Björn Bung August 1, 2012

In Jira privious to version 5 you can edit the issuessummaryblock.vm and add something like this (worked for us):

#if ($fieldVisibility.isFieldHidden('customfield_XXXXXX', $issue) == false)
#set ($customfield=$customFieldManager.getCustomFieldObject('customfield_XXXXX'))
<li class="item item-right">
<div class="wrap">
<strong class="name">$i18n.getText($customfield.name):</strong>
<span id="solution-val" class="value">
#if ($customfield.hasValue($issue))
#set($myvalue=$issue.getCustomFieldValue($customfield))
$i18n.getText($myvalue)
#else
$i18n.getText('common.words.none')
#end
</span>
</div>
</li>
#end

Does anyone know how this will work in Jira 5 and above as the file does not exist anymore?!

0 votes
Radek Kantor
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.
February 21, 2012

Hi,

try write javascript code into your CF description field, that will be change target destination. It should be possible.

0 votes
Ioannis OIKONOMOU February 21, 2012

No, it isn't the same logic. See also the attached screenshot to understand what I mean.

Thanks,

Ioannis

0 votes
Renjith Pillai
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.
February 16, 2012

Isn't it the same logic appears for viewing the issue as per your Issue Type Screen Scheme settings with your customized screen mapped to the 'View' operation?

0 votes
Ioannis OIKONOMOU February 16, 2012

I want the fields to appear in an ordered way when VIEWING the issue. When editing the issue this is not a problem because you can define the order when designing the screen. See also the attached screenshot.

Thanks,

Ioannis

0 votes
Renjith Pillai
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.
February 16, 2012

Is it that you want to order the fields while viewing/editing the issue? Isn't the ordering of fields in the screen sufficient for the same?

Suggest an answer

Log in or Sign up to answer