Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Aui-select2 is not a function on a customfield

Alberto de Ávila Hernández November 6, 2018

Hi all:

We are experiencing an issue in a Jira Server. We are trying to style a list customfield with aui-select2. To do that, we have added to the customfield description the following code:

<script type="text/javascript">
AJS.$("#customfield_10201").auiSelect2();
</script>

On a local Jira server with version 7.12.1, without any plugin, this code works fine but in a production Jira server, with version 7.11.2 it fails and shows the following error:

Uncaught TypeError: AJS.$(...).auiSelect2 is not a function

I've checked in the production environment that the Atlassian UI plugin is installed and enabled.  

The AJS version is 7.9.0

Looking for a solution we've found that some users proprose to add the following code to a velocity template:

$webResourceManager.requireResource("com.atlassian.auiplugin:aui-select2")

 but, why is it working on our dev instance wihtout doing anything but not in our production instance? 

Regards!

2 answers

1 accepted

1 vote
Answer accepted
Alberto de Ávila Hernández November 8, 2018

Finally we have found that installing a free plugin, this allow us to execute the javascript code in the creation screen. The plugin is Custom Select List 

0 votes
Tom Lister
Community Champion
November 6, 2018

Hi @Alberto de Ávila Hernández

the AUI version changed between 7.9 and 7.12 so you can expect different behaviours

see

https://developer.atlassian.com/server/jira/platform/preparing-for-jira-7-12/

Alberto de Ávila Hernández November 6, 2018

Sorry! The Jira version is 7.11.2.

7.9.0 is the AJS version.

This is also working on a Jira Server 7.3.8.

Regards!

Like vsapaev likes this

Suggest an answer

Log in or Sign up to answer