kintone.plugin.app.proxy を使用して、API (POST)「/rest/api/3/worklog/list」を使用して JIRA の worklogId を取得しています。 ただし、常にエラー 500 が返されます。
GET メソッドは引き続き正常に動作します。
以下はソースコードです。
async function proxyRequest(PLUGIN_ID, apiUrl, method, headers, body) {
return new Promise((resolve, reject) => {
kintone.plugin.app.proxy(PLUGIN_ID, apiUrl, method, headers, body, function (respBody, respStatus, respHeaders) {
resolve({ body: respBody, status: respStatus, headers: respHeaders });
}, function (error) {
reject(error);
});
});
}
await proxyRequest(PLUGIN_ID, `https://***/rest/api/2/worklog/list`, 'POST', {
'Authorization': `Basic *********`,
'Content-Type': 'application/json',
'Accept': 'application/json'
}, {
ids: ["21545"]
})