Calling WebWork Action function with parameters from velocity template

Hello. Im stuck with a strange problem.

I have a webwork module with an action class and velocity view. I can access action class methods from velocity template with $action.getIssueTypes(). This works fine until i need to pass parameters to the method. So when i use


it does not call the method, but instead prints the above instruction as text on the page. I have also tried





none of above works. As soon i have anything inside parameters bracket, it seems to be treaten as simple text by velocity.

i am sure that findTransitionsByIssueTypeId is working properly. It passes the tests. I am also sure, that there is an entry with id 1.

This is what i have


<webwork1 key="transitions-management-webwork" name="Transitions Management Webwork"
		<description key="create-and-link.components.transitions-management-webwork.description">The Successor Transition Management</description>
				<view name="input">/views/edittransition/edit.vm</view>
				<view name="success">/views/managetransitions/view.vm</view>

public class ManageTransitionsAction extends JiraWebActionSupport {

	private static final long serialVersionUID = -2086781953876101793L;
	private static final Logger log = LoggerFactory.getLogger(EditTransitionAction.class);

	private final IssueTypeManager issueTypeManager;
	private final TransitionService transitionService;

	/* Constructor */
	public ManageTransitionsAction(final IssueTypeManager issueTypeManager, final TransitionService transitionService) {
		this.issueTypeManager = issueTypeManager;
		this.transitionService = transitionService;

	public String execute() throws Exception {

		return super.execute(); // returns SUCCESS

	public Collection<IssueType> getIssueTypes() {
		return issueTypeManager.getIssueTypes();


	public Collection<Transition> findTransitionsByIssueTypeId(final String issueTypeId) {
		Collection<Transition> transitions;
		final Long id = Long.valueOf(issueTypeId);

		transitions = transitionService.findTransitionByIssueTypeId(id);"###" + transitions.size());
		return transitions;



#enable_html_escaping() ${webResourceManager.requireResourcesForContext("com.bssnsoftware.jira.create-and-link-plugin")} <h1>$action.getText('create-and-link.view.header')</h1> <table class="aui"> <thead> <tr > <th class="headrow" >Issue Type</th> <th>Transitions</th> </tr> </thead> #foreach($issueType in $action.getIssueTypes()) <tr> <td class="issuetype-column"><img src="$!{issueType.getCompleteIconUrl()}" /> $!{issueType.getName()}</td> <td class="transitions-column"> <span>${action.findTransitionsByIssueTypeId($issueType.getId())}</span> </td> </tr> #end </table> <a class="button aui-button" href="${req.contextPath}/secure/EditTransition!default.jspa" id="edit-transition-link">$action.getText('create-and-link.view.create-transition')</a> </div>



as you can see, calling $action.getIssueTypes() without parameters works fine. $action.findTransitionsByIssueTypeId($issueTypeId) does not get processed.
out of my disperation i have changed the signature of findTransitionsByIssueTypeId() to take no parameters and instead use a hardcoded id. So the call $action.findTransitionsByIssueTypeId() works.
When i touch the parameters, it does not.

Any ideas?

1 answer

1 accepted

I've found a work around. Passing parameters as Strings and converting them to proper representation (Long in my case) seems to work.

example: $action.findTransitionsByIssueTypeId("$issueTypeId")

and in action

Long issueTypeId = Long.valueOf(issueTypeIdString);

Suggest an answer

Log in or Join to answer
Community showcase
Bridget Sauer
Published an hour ago in Agile

Community Showcase: Thomas Deiler, Mountaineering Agile Coach

Thomas Deiler is a Bavarian, Mountaineering, Senior Agile Coach. In this Showcase, you will learn about his journey from software engineer to project manager, his freelance philosophy, and much more....

12 views 1 1
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot