Create a Back Button in Jira

Hi there,

I created a button (AUI button) in our JIRA plugin. Here is the HTML snippet:

<button  id="help-back-button" class="aui-button">Back</button>

 Now I want to give this button the behavior to execute the "back operation". I want to step one webpage back (namely going back to the JIRA Dashboard). I tried some Javascript code, referencing with the button's ID. However, nothing happened...could you tell me how to resolve this?


Thanks a lot in advance,


3 answers

Something like this should do the trick :

<button onClick="history.back()">click me</button>

If you don't want to write javascript directly in your HTML, you can also attach a listener and call the history.back() function from your javascript callback.

More about the history api.




This is the general idea:
<button onclick="goBack()">Back</button>

function goBack() {


Hope this helps!


Hi Christophe, thanks for answering.


I tried to solve it with javascript callback according to the history api. Here is the code

"#help-back-button").click(function() {

 Unfortunately, nothing happens. So I have two questions:  1) Is this code wrong? 2) When I have Javascript code updated, does JIRA suddenly realize this or am I obliged to use fastdev or the command atlas-run again in order to make the changes applicable?


Thanks for answering,


The code looks fine. Is your button attached to the DOM when you create the listener ? Do you have any error in the console ? Add a 'debugger' statement in your code and try step by step debugging within your browser. Usually, it is enough to reload the page to get the newest javascript.

Thanks Christophe for answering. The button is not attached to the DOM, didn't know this is required. What is the code I have to insert in the DOM? In the console I don't have errors. There is just nothing happening when clicking the button. Well, the only thing what's happening is a refresh of the current page. However, with the button I'd like to go one page back. Thanks for your help conserning the POM code. Daniel

There are thousands of ways to insert a button in the DOM Depends on your plugin implementation....

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Jira

Updates to give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

324 views 1 12
Read article

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