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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • 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

Show and hide elements in a Velocity Template using a button

Hi everyone, i'm new on creating velocities templates, and I wonder how to hide and show a table or any html element using a button, if it's clicked the element is shown, clicked again and this should be hidden, I've seen a similar question here but it didn't involved an event trigger by an action like clicking a button, thanks!

1 answer

0 votes


If you define your own velocity template then you should use Jquery to hide an element. Something like AJS.$("element").hide(). Have a look at jquery documentation.

So I can use jquery with my template so I could use something like

<button onClick="AJS.$("element").hide()">

but my question is this, if I'm gonna use jqueryl for this, besides adding the library in the head should I need more configuration to make jquery works on my template? I ask this because I tried doing this with javascript but the templates shows only velocity sintaxis and ignores completely my js.

Where do you change your velocity file? Is it a plugin you are developing?

I'm on the server using java(theres where I change it), then I use a server method to send that template to be shown on an email.

Do you mean that you change velocity templates for email? And you want Javascrit to work in outlook or something like this?

The template is on the server with the rest of my classes, then is sent as one more parameter of the server method, I guess this compiles with the rest of the app if you mean change by compile.

If you develop a Jira plugin, then JQuery must be available there. But I really do not understand what you develop. 

Would you give me an example of a template using jquery, it'd be really helpfull, thanks

Suggest an answer

Log in or Sign up to answer

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