[Solved]How to import a JS file to velocity file (JIRA SERVER ) Edited

My atlassian-plugin.xml file 


<webwork1 key="test-import" name="TestImport" i18n-name-key="test-import.name">
<description key="test-import.description">The TestImport Plugin</description>
<actions>
<action name="com.atlassian.jake.jira.webwork.TestImportAction" alias="TestImportAction">
<view name="success">/templates/test-import/success.vm</view>
<view name="input">/templates/test-import/input.vm</view>
<view name="error">/templates/test-import/error.vm</view>
</action>
</actions>
</webwork1>
<web-resource name="helloworld" i18n-name-key="helloworld.name" key="helloworld">
<description key="helloworld.description">The helloworld Plugin</description>
<resource name="hello.js" type="download" location="js/hello.js"/>
</web-resource>



My hello.js file located in resources/js/hello.js:

$(function() {
alert("haha");
console.log("Sucessfully Reloaded")
});

My success.vm file :

<!DOCTYPE html>
<html lang="en">
<head>
<title>JavaScript - read JSON from URL</title>

$webResourceManager.requireResource("com.atlassian.jake.myPlugin:helloworld")
</head>

<body>

<header id="header" role="banner"></header>
<h1>Successfully</h1>
<p>Now it looks nice :)</p>
</body>
</html>







But when i load the plugin , it not run what in the js file.
Please help me

[Solve: It turns out that the js file have to be as the same name with the plugin name . I dont know why]

 

1 answer

This widget could not be displayed.

Hi!

Thank you for letting us know you were able to solve the issue.

You can provide your resolution as a separate answer, and then accept the answer, and it will then be marked as solved. :) 

 

Let us know if you have any trouble!

Kind Regards,
Shannon

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

85 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you