Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Extended Multiselect Custom Field

V December 3, 2012

I am developing an extended multiselect field. If i use same velocity template (view-multiselect.vm) for view and edit screen, why the output is different on view and edit screen?

View screen displays option values and edit screen displays option id.

<resource type="velocity" name="view" location="templates/plugins/fields/view/view-multiselect.vm"/>
<resource type="velocity" name="edit" location="templates/plugins/fields/view/view-multiselect.vm"/>

I want to get values on edit issue screen.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Umair Haroon
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 6, 2014

Why would you use the same vm file?

Use the edit one (different vm ) for the Edit and the View one which you have for view.

0 votes
Mizan
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.
December 3, 2012

I think you will need to modify your edit-vm file .

below is an example of edit view customfield

&lt;select name="$customField.id" id="$customField.id" multiple size="5"&gt;
        &lt;option value="-1"&gt;None&lt;/option&gt;
    #foreach ($option in $options)
            &lt;option value="$option.id"&gt;$option.name&lt;/option&gt;
    #end
&lt;/select&gt;

V December 3, 2012

Thanks Mizan.

I want to display selected multiselect values for an Issue on edit screen.

As i mentioned, i used same template (templates/plugins/fields/view/view-multiselect.vm) for edit and view. $value contains different value on edit and view template.

On create it contains list of option values from Issue and on edit it contains list of option ids from Issue. I am not overriding getValueFromIssue method. Any idea how can i get selected option values in place of ID on edit screen?

Mizan
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.
December 3, 2012

can you provide the edit vm file ? may be you are displaying the ids instead of values ...

TAGS
AUG Leaders

Atlassian Community Events