Is there field type similar to Multiple Version Picker?

Vishnu C November 18, 2019

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

3 answers

0 votes
Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 18, 2019

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

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2019

@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>
Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2019

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

Vishnu C December 6, 2019

@Kian Stack Mumo Systems 

 

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. custom.png

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 6, 2019

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.

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 6, 2019

Try loading it in a different browser. You can disable javascript temporarily on the browser. https://www.searchenginepeople.com/blog/disable-javascript.html

Vishnu C December 6, 2019

Problem is n my company they disabled the options to change the browser settings.

0 votes
Vishnu C November 18, 2019

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.

Vishnu C December 6, 2019

That is correct. Module field should be an auto suggest field values but no access for end user to add new values to the list.

0 votes
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 18, 2019

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.

Vishnu C November 18, 2019

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.

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2019

Ahh, I see. I misunderstood  your requirements.

Atlassian actually has a document outlining how this can be done. Check it out here.

Suggest an answer

Log in or Sign up to answer