Hello everyone,
I'm using the Jira REST API for the first time to retrieve versioning information. However, when I try to request project data via the API, I get a response indicating that I don’t have the "Browse Projects" permission:
{ "permissions": { "BROWSE_PROJECTS": { "id": "10", "key": "BROWSE_PROJECTS", "name": "Browse Projects", "type": "PROJECT", "description": "Ability to browse projects and the issues within them.", "havePermission": false } } }
However, from the Jira web interface, I can access all the project and versioning details without any issues.
My Jira administrator confirmed that I have the "Browse Projects" permission in the UI.
Any help would be greatly appreciated. Thanks in advance!
Hi @Nicola Reali ,
API access is handled with the same permissions as the UI access.
As long as you use a personal API token then the api call will have the same permission as the user it was generated for. There are also no other permissions required to use the API's.
Could you perhaps elaborate a bit on what api call you are trying to make and what the specific response is that is returned?
I'm testing the API token with the following request:
curl -X GET -u "myemail:TOKENprovidedbyIT" -H "Accept: application/json" "https://XXXX.atlassian.net/rest/api/3/mypermissions?permissions=BROWSE_PROJECTS"
The response I receive is:
{
"permissions": {
"BROWSE_PROJECTS": {
"id": "10",
"key": "BROWSE_PROJECTS",
"name": "Browse Projects",
"type": "PROJECT",
"description": "Ability to browse projects and the issues within them.",
"havePermission": false
}
}
}
I'm new to working with APIs, so apologies if I'm not explaining this clearly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Additionally, my goal is to retrieve information about specific release versions based on their name rather than their ID. I need details such as status, start date, and release date.
These requests will be dynamically triggered by Power BI based on an analysis of Salesforce data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well the call you're doing is one to validate a permission.
I'd suggest to actually try and do the call to get the versions and see what error that gives.
Since the call to get a specific version on a project requires the Id you'll most likely first need to get a list of all versions and their id's and then do a second call with the proper id (although the full list might provide all the info you need)
Also make sure the email and token are for the same account (i ask since you mention IT provided you with the token so perhaps it's under a different email account?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm testing the API using the command prompt with the following request:
curl -X GET "https://XXXX.atlassian.net/rest/api/3/project/AAA/versions" -u "Myemail:mytoken" -H "Accept: application/json"
However, I receive this response:
{"errorMessages":["No project could be found with key 'AAA'."],"errors":{}}
I'm certain that 'AAA' is the correct project key, as I can see it in Jira and successfully apply filters using JQL.
Is there any specific reason why the API doesn't recognize the project key?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dirk Ronsmans, I've tried something different. I'm using basic auth, and if I use another email with the same token, I have some info about the permission.
That means that I'm not authenticated, in fact if I ask for:
/rest/api/3/myself
As a response, I receive:
Client must be authenticated to access this resource.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.