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"> 
    <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"/>  

  <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"/>

Here is the Velocity view:

    My Plugin


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


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?