This recipe covers a very simple concept in JIRA web actions. While writing plugins, we often come across scenarios where we need to navigate to a new page such as a Dashboard or to browse a new project or view another issue after the action is executed. JiraWebActionSupport
provides a simple method for doing this, which we will see in this recipe.
What if we want to navigate to the Dashboard instead of rendering a success view when an action is executed? What if we can't directly link it from the JSP page or the Velocity template because we want to perform something in the action class before we redirect?
All you need here is to return getRedirect(URL)
in the action class' doExecute
method (or the appropriate method)! This method will redirect to the specified location when the action method is successfully finished. If there are any errors, it will go to the error page as the getRedirect()
method returns Action.ERROR
in that...