Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira plugin doesn't render velocity Edited

I'm developing a plugin (web panel) but it doesn't load any velocity template/code.

 

Following this: https://developer.atlassian.com/server/jira/platform/web-panel/#web-panel-examples

I tried the static resource and it rendered correctly but when it comes to velocity, the location nor the embedded version doesn't show anything.

blank.png

My atlassian-plugin.xml

<web-panel key="release-page-key" location="path">
<resource name="view" type="velocity"><![CDATA[My name is test]]></resource>
<context-provider class="path-to-class"/>
<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
</web-panel>

As you can see, I tried the embedded velocity code, but all it shows is empty blank page. Only the static version works, i.e.

<web-panel key="release-page-key" location="cz.oksystem.plugins.jira.webpanel:dependency-graph">
<resource name="view" type="static"><![CDATA[Hello World]]></resource>
<context-provider class="cz.oksystem.plugins.jira.webpanel.DependencyGraphServlet"/>
<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
</web-panel>

notblank.png

Other than this, I didn't change anything. Am I missing something?

 

I'm currently using Atlassian plugin SDK 8.0.7

 

---

SOLUTION:

I imported this dependency

<dependency>
<groupId>com.atlassian.templaterenderer</groupId>
<artifactId>atlassian-template-renderer-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>

2 answers

0 votes
DPK J Community Leader Jan 14, 2020

@Minh Trieu  You will need to add location of velocity file, so your atlassian-plugin.xml should look like this,

<web-panel key="release-page-key" location="path">
<resource name="view" type="velocity" location="templates/view.vm" />
<context-provider class="path-to-class"/>
<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition"/>
</web-panel>

and templates/view.vm (inside resources directory of your plugin) should look like,

<h1>My name is Test</h1>

I already tried this, but it doesn't do anything. I tried the three variants mentioned here: https://developer.atlassian.com/server/jira/platform/web-panel/#web-panel-examples but none of them are working for velocity. The embedded and the location file

This is how the project structure looks like. I tried again exactly what you've suggested but nothing happened. Still a blank page

 

Untitled.png

OK nvm, I found my solution. The only thing I had to do was to import the dependency

 

<dependency>
<groupId>com.atlassian.templaterenderer</groupId>
<artifactId>atlassian-template-renderer-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you