Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Issues where User has access

danish_kaleem December 20, 2021

Let users in Jira ADMIN, ABC, XYZ, QWER. 

We are using JIRA API to read issues related data (using Basic Auth/ Admin Account). Now I want to search issues for the user. 

My basic idea is to use this in type and search bar e.g. if user types 130 then bring all issues which have 130 in Id and this user has access. 


Now issue is as we are using Admin Account credentials, so when we call 
https://example.atlassian.net/rest/api/3/issue/picker?currentJQL=130%26showSubTaskParent=true%26showSubTasks=true

for ABC user, this returns all items whether ABC has access or not. I understand the reason that this is running in the scope of ADMIN. 

So what i want to achieve is to pass some parameter in JQL syntax or any other to fetch all issues starting from 130 suppose and ABC has access to it.

Similarly when XYZ call this only fetch which this user has access to.  

So kindly let me know if there is any way using JQL or other using which we can fetch all issues where ABC user has access.

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 28, 2021

Hi Danish,

Since you are calling the endpoint of GET /rest/api/3/issue/picker this endpoint is designed to work a bit differently than other kinds of searches in Jira.  Within the web interface of Jira, this endpoint can be called in order to help the searching of issues either within the quick search or to help autocomplete some terms in other search boxes.

From what I can see about this, I think you want to instead be calling the endpoint GET /rest/api/3/search.  The reason for this is noted in the details of that endpoint:

Permissions required: Issues are included in the response where the user has:

Since this endpoint has required permissions to view specific issues, this is really what you want to ultimately be calling because we don't want to show end users issues that they do not have access to view.  This endpoint is only able to return issues that user calling it can view.

You will probably need to adjust the query parameter to match this endpoint.  So the address being called might look something more like this:

https://your-domain.atlassian.net/rest/api/3/search?jql=text~"130"

I realize this might not work in exactly the same way as the other endpoint because of the differences in the way each endpoint works.  But perhaps you can let me know some more information about this 130 value.  Are there several field values that start with that string that you are trying to filter for, such as 1304, 1309, etc.  Can you tell me more about the field type being used here? (ie, is this is number field, a text field, a select list, or something like a labels field?)

Andy

Suggest an answer

Log in or Sign up to answer