Trouble is: PUT is successful, no error code but data not updated.
On the client side within my Atlassian Connect IFrame I am trying to send a PUT request as below.
scopes in my descriptor.json:
"scopes": [
"read",
"write",
"delete"
], This is run on my dev instance of JIRA cloud under admin user.
Request:
AP.request({
url: '/rest/api/2/issue/XCV-17',
method: 'PUT',
data: { "update": { "labels": [ { "add": "zzz" } ] } },
dataType: 'json',
contentType: 'application/json',
success: function(msg) { alert("success:\n" + JSON.stringify(msg)); },
error: function(msg) { alert("error:\n" + JSON.stringify(msg)); }
});
I am not receiving any error code. In fact, I see success callback being triggered (with payload containing all the JIRA issue data), yet there are no label updated/created on the issue (tried refreshing the page, opening edit dialog after the request - nothing).
In the console I see this mystic warning "[Simple-XDM] Failed to validate origin: https://xxxx.atlassian.net"
I created the request to avoid CORS per https://developer.atlassian.com/cloud/jira/platform/jsapi/request/
REST API doc: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-issueIdOrKey-put
A similar GET request I run on the same IFrame is successful and returns valid data every time.
I tried stringifying the data I am passing into the PUT request - no change.
I am quite stuck with this and would appreciate any direction.