How to get roles via Rest apis

Pradnya Mhatre May 25, 2015

Hi,

I wanted to know how to get roles listed at http://www.example.com/secure/project/ViewProjectRoles.jspa 

via rest api?

As per the documents, there is an api https://docs.atlassian.com/jira/REST/latest/#d2e1999 which doesn't work at all, I am getting following message.

<status>
<status-code>404</status-code>
 <message>
</message>
</status>

Any pointer or suggestion would be great!

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 25, 2015

Hi Pradnya!

 I guess that you have JIRA prior to 6.4."/rest/api/2/role" appears starting from version 6.4.

maybe you can use "/rest/api/2/project/{projectIdOrKey}/role" that "Contains a list of roles in this project with links to full details." and is available since JIRA 5.0.

Pradnya

Pradnya Mhatre May 25, 2015

Oh yes, my jira version is 6.3.11. Thanks!

1 vote
João Palharini
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 25, 2015

Hi Pradnya!

The error you're getting is related to the request you made not being able to encounter the page you're looking for. Could you check if the URL used on this request is the same one you use to access JIRA? Also, make sure to include the context path of your application if you configured it to use one.

See examples of URLs using this REST call below:

# Accessed locally, in port 8080 with context path /jira:
http://localhost:8080/jira/rest/api/2/role

# Accessed through a FQDN (on the internet), in port 80 with context path /jira:
http://yourdomain.com/jira/rest/api/2/role

# Accessed locally, in port 8080 without context path:
http://localhost:8080/rest/api/2/role

# Accessed through a FQDN (on the internet), in port 80 without context path:
http://yourdomain.com/rest/api/2/role

Let me know if you have any more doubts on this. wink

--
Cheers!

Joao

TAGS
AUG Leaders

Atlassian Community Events