How to transfer parameters from Gadget to REST method ? Edited

I have a gadget that consumes a REST resource via AJAX call:

args: [
key: "version",
ajaxOptions: function ()
return {
url: "/rest/daysleftinversionresource/1.0/days-left-in-iteration/getVersion",
data: {
projectId : gadgets.util.unescapeString(this.getPref("projectId")),

==> from the other side, the REST resource method is as follow

	//@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
	public Response getVersionMethod(@QueryParam("project_id") @DefaultValue("project-10000") String key)
		Long projectId = Long.valueOf(key.substring("project-".length()));


The method is always taking the default value and a warning about parameters is being consumed by a servlet is raised and a recommendation to use @FormParam instead of @QueryParam is given.

I am confused and troied so many alternatives but couldnt find a solution how to transfer my param from Gadget to REST Method,.

Do you have any recommendation ?


1 answer

1 accepted

I discovered the issue was a type in the project_id QueryParam. It should much the Gadget projectId variable.

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published yesterday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

239 views 5 14
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