Я пытаюсь реализовать скрипт tampermonkey, который запускает API-вызов к экземпляру Jira, чтобы создать заявку с некоторой информацией, найденной на странице, на которой я нахожусь (в другом домене). Вот что я пробовал:
async function createJiraTicket() {
let elements = await obtainThingsForCreatingJiraTicket();
let createJiraTicketUrl = `https://${jiraDomain}/rest/api/latest/issue`;
let requestDataForCreation =`
{
"fields": {
"project": { "key": "${elements.project}" },
"summary": "${elements.title}",
"description": "nothing",
"issuetype": {"name": "Issue" }
}
}`;
GM_xmlhttpRequest ( {
method: "POST",
url: `${http}://${createJiraTicketUrl}`,
user: 'user:pwd', // also tried user:'user', password:'pwd',
data: requestDataForCreation,
header: 'Accept: application/json',
dataType: 'json',
contentType: 'application/json',
onload: function (response) {
jiraTicketLog(`[Ajax] Response from Ajax call Received: `);
}
} );
Однако, когда я запускаю createJiraTicket (), я получаю следующую ошибку:
Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
at <anonymous>:1:7
Я установил правильные теги @connect для сценарий, так что я совершенно не знаю, в чем проблема ...
Может кто-нибудь помочь? Спасибо