Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how send query from gadget.xml?

dr6den dr6den
Contributor
July 4, 2011
I tried simply get and its doesnt work too

<Content type="html" view="profile">
<![CDATA[
<div id="hope"/>
#requireResource("com.atlassian.jira.gadgets:common")
#includeResources()
<input type="button" id="art"></input>
<script type="text/javascript">

jQuery(document).ready(function(){
jQuery("#art").click(function() {
jQuery.get("/jira/plugins/servlet/children", {"parentid":"3"}, function(data) {
});
});
});
</script>
]]>
</Content>
firebug show that query didnt send when button was pressed.
how send query from gadget.xml?
such query good works in my application in templates
I tried rest api and it didnt work to:

(function () {
var gadget = AJS.Gadget({
baseUrl: "__ATLASSIAN_BASE_URL__",
view: { ..........

}
});
})();


2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
João Junior July 6, 2011

The method is being called in REST?

0 votes
dr6den dr6den
Contributor
July 6, 2011

full code of gadget.xml

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Edit_Employee_Data"
title_url="__MSG_gadget.title.url__"
directory_title="__MSG_gadget.title__"
description="__MSG_gadget.description__"
author="Andrew Denysenko"
author_email="bo.wang@customware.net"
screenshot='#staticResourceUrl("com.homecredit.plugins:employeeDataGadget", "star_red")'
thumbnail='#staticResourceUrl("com.homecredit.plugins:employeeDataGadget", "user_16.gif")'
>
<Optional feature="gadget-directory">
<Param name="categories">
JIRA
</Param>
</Optional>

</ModulePrefs>
<UserPref name="isConfigured" datatype="hidden" default_value="false"/>
<Content view="profile">
<![CDATA[

#requireResource("com.atlassian.jira.gadgets:common")
#includeResources()


<script type="text/javascript">
(function () {
var gadget = AJS.Gadget({
baseUrl: "__ATLASSIAN_BASE_URL__",
view: {
template: function(args) {
var gadget = this;
var userDetails = AJS.$("<h1/>").text("Hello, "+args.user["fullName"]);
gadget.getView().html(userDetails);
},
args: [{
key: "user",
ajaxOptions: function() {
return {
url: "/rest/gadget/1.0/currentUser"
};
}
}]
}
});
})();



</script>

]]>
</Content>
</Module>

TAGS
AUG Leaders

Atlassian Community Events