Help with saving input to a Active Object using rest

So I have been trying to store some user input into a active object but I can’t seem to get it to work. I have tried all kinds of variations on the code but nothing I try works. Could someone fix my mess or atleast point me in the right direction because I’m at a loss as to what I’m doing wrong?

Basically what I’m doing now is putting a value inside a input field in my velocity file. This value can be changed by the user and when he clicks on the button the input should save to my TestEntity Active Object using the rest API. I think my mistake lies with either the ajax call or the restResource itself.

My query in the .js file

AJS.$('#searchButton2').click(function (){
            type: "post",
            dataType: 'json',
            async: false,
            data: ({issueKey : document.getElementById("issueKeyInput").value, 
                      content: document.getElementById("passwordInput").value}), 
            success: function(data)

My rest resource file

public class TestResource{
    private final ActiveObjects ao;

    public PasswordResource(ActiveObjects ao){ = ao;}

    public Response save(@QueryParam("issueKey") final String issueKey, @QueryParam("content") String passJson)
        return ao.executeInTransaction(new TransactionCallback<Response>() {
            public Response doInTransaction() {
                TestEntity[] existingAll = ao.find(TestEntity.class,"ISSUE = ?", issueKey));
                TestEntity existing = existingAll[0];

                if (existing != null){
                else {
                    TestEntity newTestEntity = ao.create(TestEntity.class);
                return null;

My velocity file


    <input id="testInput" name="testInput">$testInput</input>
    <input class="hidden" id="issueKeyInput" name="issueKeyInput">$input</input>
    <button id="searchButton2" class="aui-button" name="searchButton2">Zoeken2</button>

(Dont mind the hidden input field here I have yet to figure out how I can send value like $input into a seperate .js file )

My Entity

public interface TestEntity extends Entity {

    String getIssue();
    void setIssue(String issue);

    String getContent();
    void setContent(String content);


Any help you might be able to provide me would be greatly appreaciated!

The REST method save is expecting jira/rest/testresource/1.0/test/{issueKey}?issuekey={issueKey}&content={content}.

Your AJAX method is firing a POST to jira/rest/testresource/1.0/test with a payload of


You can’t use a Payload, QueryParams, and PathParams interchangeably like this. They are not the same. You can either update your REST Resource or your AJAX call.

Hi Jeffery, I am wondering if you can provide the code that generates the JSON data from the active object, I am looking to write out @GET methods that return json from Active Objects.