I am trying to create a few roles with my plugin. I am logged in as an admin and trying to add roles using rest api but I keep getting 403 response. In my atlassian-connecct.json file I already have
"scopes": [ "READ",
"WRITE",
"ADMIN"
],
Code I have written looks like this:
var role={
"name": "Product Owner",
"description": "Product Owner to discover the product"
};
AP.require('request', function(request) {
request({
type: "POST",
url: "/rest/api/2/role",
dataType: "json",
data: JSON.stringify(role),
contentType: "application/json",
success: function(response) {
response = JSON.parse(response);
console.log(response)
},
error: function(response) {
},
});
});