/rest/api/2/role gives 403 (Forbidden)

350 views
Skip to first unread message

Alok Kumar Singh

unread,
Apr 18, 2016, 9:48:33 AM4/18/16
to Atlassian Connect Dev
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) {



},

});

});


Seb Ruiz

unread,
Apr 18, 2016, 10:38:32 AM4/18/16
to atlassian-...@googlegroups.com
Hi,

As explained in our docs the /role endpoint can only be read and not created/updated (i.e GET requests only).

Please create an issue in the JIRA Ecosystem project which explains your use case and the team will triage and take it into consideration for a future release.

Kind regards,
Seb

--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Seb Ruiz
Atlassian
Message has been deleted

Alok Kumar Singh

unread,
Apr 18, 2016, 3:20:55 PM4/18/16
to Atlassian Connect Dev

Regards,
Alok Singh 

Khanh Nguyen

unread,
Apr 18, 2016, 6:32:35 PM4/18/16
to Atlassian Connect Dev
Hi Alok,

We currently do not support all the endpoints listed in the JIRA REST API due to security concerns amongst other reasons. As mentioned by Seb above, Atlassian Connect addons only have permission to read (GET) from the '/role' endpoint as seen the our documentation for JIRA REST API Scopes https://developer.atlassian.com/static/connect/docs/latest/scopes/jira-rest-scopes.html

Kind regards,
Khanh

Alok Kumar Singh

unread,
Apr 19, 2016, 2:24:58 AM4/19/16
to Atlassian Connect Dev
So there is no way I can create new roles with my plugin in JIRA ?

Best Wishes,
Alok Singh

Khanh Nguyen

unread,
Apr 19, 2016, 3:10:05 AM4/19/16
to Atlassian Connect Dev
Correct.

However, as Seb mentioned above, you can go to the JIRA Ecosystem project and raise an issue which explains your use case for creating/updating roles and the Atlassian Connect team will triage and take it into consideration for a future release.


Kind regards,
Khanh

Alok Kumar Singh

unread,
May 9, 2016, 5:32:53 AM5/9/16
to Atlassian Connect Dev
Hi ,
I have created an issue to open this api https://ecosystem.atlassian.net/browse/ACJIRA-937.

Regards,
Alok Singh

On Monday, April 18, 2016 at 7:18:33 PM UTC+5:30, Alok Kumar Singh wrote:
Reply all
Reply to author
Forward
0 new messages