Hello,
I’m trying to save user properties from a Jira cloud add-on, but I’m getting a 403 return code. The scenario is that the current logged in user trigger a property saving thru the UI (the following code is running in the client side/UI).
Any clue on what’s missing? Thank you!
F.
Code excerpt:
setupAjax: function()
{
var token = $("meta[name=token]");
$.ajaxSetup(
{
headers: {
'Authorization': 'JWT ' + token.attr("content"),
'Accept': 'application/json',
'Content-Type': 'application/json' }
});
}
AP.require('request', function(request)
{
request(
{
url: '/rest/api/3/user/properties/' + propertyKey + '?accountId=' + deeperData.atlassianAccountId,
type: 'PUT',
body: deeperData.productTourSections,
success: function(response)
{
console.log("saveUserPropertiesPromise():success");
console.log(response);
},
error: function(response)
{
console.log("saveUserPropertiesPromise():error");
console.log(response);
}
});
});
Add-on descriptor excerpt:
"scopes": [
"READ",
"WRITE",
"DELETE",
"PROJECT_ADMIN",
"ADMIN",
"ACT_AS_USER"
]