JIRA Plugin custom field multi select

hi dear community,

I have write a custom field which get values from an external SQL database and read it in a multi selected custom field.

If I set a value to the custom field all is working fine, but there is a problem if I move the Issue to a another project the value is still exist in the new issue, although it doesn't have values in the other project. 

The database query select our available teams for a specific project.



public class FunctionalTeamCF extends GenericTextCFType


    private static Connection conn;

    private static Statement statement;



    protected FunctionalTeamCF(CustomFieldValuePersister customFieldValuePersister,

            GenericConfigManager genericConfigManager,

            TextFieldCharacterLengthValidator textFieldCharacterLengthValidator,

            JiraAuthenticationContext jiraAuthenticationContext) {

        super(customFieldValuePersister, genericConfigManager, textFieldCharacterLengthValidator, jiraAuthenticationContext);




    public Map getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)


        Map map = new HashMap();

        Map<String, String> results = new HashMap<String, String>();    


        //aktuelles Issue Projekt

        String project = issue.getProjectObject().getKey();            

        results = getValues(project);;


        if(!results.isEmpty() && results != null)


            map.put("results", results);




            map.put("results", "None");


        return map;



I suspect that the velocity template file edit.vm makes the problems..


#* @vtlvariable name="results" type="java.util.Map" *#
#controlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters.noHeader)

    #if($value && !$value.equals(""))
    #set ($displayValue = ${value})
    #if($results && !$results.equals("") && !$results.empty)
        <select class="text long-field" name="$customField.id" id="$customField.id" >
           <option value="">None</option>
           #foreach ($mapEntry in $results.entrySet())
                <option value="$mapEntry.key">$mapEntry.value</option>
        <select class="text long-field" name="$customField.id" id="$customField.id" >
            <option value="">None</option>
        #set ($Value = "")

#controlFooter ($action $fieldLayoutItem.fieldDescription $displayParameters.noHeader)

2 answers


Your code will read the value and store it in the JIRA database, however it will not refresh that value when you move the issue to another project. So you need to understand that once the value is stored it will not be updated as a "live value" until your code is executed again. 

Depending on how frequently you move issues it may be worthwhile having a "refresh values" step in your workflow for those times when you need to update that would execute your code and store the values pulled at that time. These would then use the parameters from the new project rather than the previous project.

Hope this helps


Is there a specific method in the JIRA SDK which I could use for an issue update in the JIRA database ?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,076 views 13 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot