Importing javascript file into my soy template

I have a soy template located in /resources/templates/ I’m trying to import a javascript that is located in /resources/js/chartsMaker.js and I tried the following and it didn’t work:

{namespace plugin.contributions}

 * Contribution tab
{template .contributionsTab}
            <script src="chartsMaker.js"></script>
            <h1>Hello World</h1>            

Hi Murtada,
you need to declare your JS files as web-resources in atlassian-plugin.xml, best practice is to define a web-resource context and load the web-resource via its context in the soy template with

{template .contributionsTab}

Hope that helps.
Best, Ulrich

1 Like