I want to pass the values from the form and generate some value and return that value to the form. The return value generation is done in REST web service. How to pass the values from the from to that REST service?
Using Jquery you can send ajax request to the REST service and then populate your forms :
Jquery can be used in javascript under Jira with this :
ASJ.$
For example, if your form is (the user put "john" in the text input)
<input type="text" id="myvaluetosend" value="john"/>
<input type="text" id="resultOfRESTCall"/>
to send "john" to the webservice and display the result in the text input with id "resultOfRESTCall"
you can send a request :
AJS.$.get('http..URL_OF_REST_SERVICE',
{"name-of-rest-parameter":AJS.$("#myvaluetosend").val()},
function (data)
{
// Here is where I can manage the data sended by the REST service
// Assuming the JSON resultsended by the rest service is {"result":"hi john"}
// Populate the form with the result:
AJS.$("#resultOfRESTCall".val(data.result));
}
);
I only use this on Gadgets for the dashboard, I assume it works on plugins...
Regards,
Anthony
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.