I use JIRA v6.1.3.
My project has some released version. eg. (V1.0 , V1.0.1 , V1.0.2 , V1.0.3, V1.1 , V1.1.1 , V1.1.2 )
I need to hide V1.0 to V1.1.1 when people create an issue.
And why I don't choose to archive V1.0 to V1.1.1 versions,is that archived versions related issues can not be searched in issue navigator.
I tried to use AJS in Behaviours Plugin
FormField versions = getFieldById("versions")
FormField desc = getFieldById("description")
if(getActionName()!=null && getActionName()=="Create Issue"){
desc.setFormValue("create screen:"+getActionName()+versions.getValue())
versions.setHelpText("<script type=\"text/javascript\">\
AJS.\$(\"#versions optgroup\").each(function() { \
AJS.\$(\"#environment\").val(\"22\"+AJS.\$(this).attr('label'));\
if (AJS.\$(this).attr('label')==\"Released Versions\"){ \
AJS.\$(\"#environment\").val(\"333\");\
AJS.\$(this).find('option').each(function() {AJS.\$(this).hide();});\
}\
});\
</script>")
}but
AJS.\$(this).find('option').each(function() {AJS.\$(this).hide();});\this code didn't work