I'm creating a Module field where I need to have the user select multiple module values. Similar type of Fix Version field where we can select multiple module names with auto suggest option
Hi @Vishnu C ,
I'm not sure I got you or not
If my understanding correct, you want your multi-select field should behave like component/s or version picker fields. so that when user start typing it should filter the value and allow them to select from them
if so you can follow below steps to achieve it
1. Create Select List(Multi choice) field with your options
2. If the field is going to be used by only your project place the following javascript in field's description else go to respective project's field configuration and edit Module(custom field) field place the same there in field's description
<script type="text/javascript">
(function($){
new AJS.MultiSelect(
{
element: $("#customfield_13711"), itemAttrDisplayed: "label", errorMessage: AJS.params.multiselectComponentsError //need to place valid custom field ID there
});
})(AJS.$);
</script>
BR,
Leo
@LeoWhere did you get your code? Just wondering since the Atlassian document has some differences:
<script type="text/javascript">
(function($) {
AJS.$("#customfield_<cf-id> option[value='-1']").remove(); //Removes the default value "None"
function convertMulti(id){
if (AJS.$('#'+id+"-textarea").length == 0){
new AJS.MultiSelect({
element: $("#"+id),
itemAttrDisplayed: "label",
errorMessage: AJS.params.multiselectComponentsError
});
}
}
AJS.toInit(function(){
convertMulti("customfield_<cf-id>");
})
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
AJS.$("#customfield_<cf-id> option[value='-1']").remove();
convertMulti("customfield_<cf-id>");
});
})(AJS.$);
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot actually it was in my old docs, which still works in newer versions of jira as well(I've verified in 8)
And one more thing, above snippet will remove "None" value from select list. but I didn't include that into my JS code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added the script in custom field description. Now the field got disabled and Create bug keeps loading I cant open the Create link itself. After deleting the field from the screen I'm able to create the issue. But another problem is I cant delete this custom field now. When I search for the word Multi itself the screen is non editable. I cant access the fields also. please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry, it is working for me. If it prevents you from loading I would disable it for now until you can get it working in a test environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try loading it in a different browser. You can disable javascript temporarily on the browser. https://www.searchenginepeople.com/blog/disable-javascript.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kian,
Not sure I'm following you correctly. You mean to say that create a custom field of type multi select but I don't think that will provide the picker option with auto suggest.
Requirement is to create a new field called Module and it needs to have different value not like version value but it should be Fix Version data type like Picker with auto suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vishnu,
You can add version picker fields which allow you to pick from the releases/versions defined in a project.
You can also define multi select lists if you want to define the values globally.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kian,
Not sure I'm following you correctly. You mean to say that create a custom field of type multi select but I don't think that will provide the picker option with auto suggest.
Requirement is to create a new field called Module and it needs to have different value not like version value but it should be Fix Version data type like Picker with auto suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh, I see. I misunderstood your requirements.
Atlassian actually has a document outlining how this can be done. Check it out here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.