1

我想通过 jQuery 在 Redmine 中创建一个新任务。我尝试了下面的代码,但没有成功。

function createIssue() {

        var payload = {
            "issue": {
                "project_id": 127,
                "subject": "Example",
                "tracker_id": 208,
                "priority_id": 4
            }
        }

        var RedMine_Root = "http://xxxxxxxxxxxxxxxxxxxxxx/redmine";

        $.ajax({
            type: "POST",
            dataType: 'jsonp',
            contentType: "application/json",
            data: payload,
            url: RedMine_Root + "/issues.json",
        }).done(function (data) {
            console.log("ok");
        })
        .fail(function (jqXHR, textStatus, err) {
            $('#tarefa').text('Error: ' + err);
        });



    }

当您单击按钮时,没有任何反应。如何使用上述功能?您如何进行身份验证?

4

0 回答 0