"webResourceManager.requireResource" is not working in Bitbucket

Hello Guys,

We are trying to create a .vm in our plugin and inside this .vm we need to use a .js. We did below:
In atlassian-plugin.xml, we put:

    <web-resource name="Plugin-Development Web Resources" key="resources">
        <dependency>com.atlassian.auiplugin:ajs</dependency>
        <resource type="download" name="admin.js" location="js/configs/admin.js"/>
    </web-resource>

In our admin.js, we only put below:

   AJS.toInit(function($) {
      console.log ("test");
    });

In our .vm (admin.vm), we put the following, so, we can have our .js called there:

    $webResourceManager.requireResource("com.murex.plugin.murex-plugin:resources")

But, We didn’t get admin.js launched. Noting that we are doing exactly the same in Confluence and JIra. “webResourceManager.requireResource” is not working in Bitbucket? If not, what is the alternative solution?

Many thanks,
Rosy

Hi @rosy.salame,

Could you try explicitly adding com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager as a dependency in your web-resource entry? I think that’s technically also necessary on Jira and Confluence, but something else just pulls that in by default.

Cheers,
Tobias

1 Like

Hi @tobitheo, thanks a lot :slight_smile: It is working perfectly!

Thanks,
Rosy

1 Like