P2 Plugin Atlassian AJS not working on Customer Portal

I have a Web Panel on customer portal, here is the code:

  <web-resource key="my-plugin-resources" name="my-plugin Web Resources"> 
    <dependency>com.atlassian.auiplugin:ajs</dependency>  
    <resource type="download" name="my-plugin.css" location="/css/my-plugin.css"/>  
    <resource type="download" name="my-plugin.js" location="/js/my-plugin.js"/>  
    <resource type="download" name="images/" location="/images"/>  
    <context>my-plugin</context> 
    <context>jira.view.issue</context>
    <context>customerportal</context>
  </web-resource>

  <web-panel name="My Panel" i18n-name-key="my-panel.name" key="my-panel" location="servicedesk.portal.subheader.view_request" weight="1000">
    <description key="my-panel.description">The My Panel Plugin</description>
    <resource name="view" type="velocity" location="templates/panel-context.vm"/>
    <context-provider class="com.company.context.MyPanelContext"/>
  </web-panel>

Here is the Velocity view:

<h1>
    My Plugin
</h1>

<script>

    AJS.toInit(function () {
        console.log("ajs working");
    });

</script>

And this is the JS file from Web resources (my-plugin.js) :

AJS.toInit(function () {
    console.log("ajs from JS file is working");
});

The problem is that My Panel is seen on Customer Portal, but Javascript is not working there. On Jira Issue view context everything works, but on Customer portal pages AJS is not working. Neither JS script from velocity nor JS file are working. Do I need to add any configuration for customer portal? Any ideas?

2 Likes