Forums

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

how can i get issue field of a project using oauth2

masskoder November 8, 2020

Hey Everyone,

I'm trying to get an issue from a project and its work but I did get issues field.

There is how I did :

1. use Oauth2 to get user authorization with scope: Jira-work
2. querying to get project ID ( work )
3. querying to get issue with this link : "https://api.atlassian.com/ex/jira/" . $cloudId . "/rest/api/2/project/search?jql=project%3D" . $projectId . "&fields=issue,status,name&startAt=0&maxResults=500";

For this last API call i get only those fields :

Screen Shot 2020-11-08 at 9.00.28 PM.png

could you please tell me how to get issues field ?

1 answer

1 accepted

0 votes
Answer accepted
Hana Kučerová
Community Champion
November 9, 2020

Hi @masskoder ,

welcome to the community!

If I understand your problem correctly, what you are trying to do is to get issues in the specific project.

You can use issue search endpoint with JQL: project=xxx, where xxx is your project id 

masskoder November 10, 2020

Hi @Hana Kučerová 

Thanks for your quick answer.

I try again with this endpoint :  https://api.atlassian.com/ex/jira/" . $cloudId . "/rest/api/3/project/search?jql=project=" . $projectId ;

I still get only project fields in response, not issues fields.

Hana Kučerová
Community Champion
November 10, 2020

Hi @masskoder ,

please replace

"/rest/api/3/project/search?jql=project=" . $projectId ;

with

"/rest/api/3/search?jql=project=" . $projectId ; 

If there's the word "project" in the endpoint, it returns information about projects, otherwise about issues...

masskoder November 10, 2020

Thanks @Hana Kučerová  , it's works. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events