Forums

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

How to access Jira project exists api using javascript

ChandlerBing November 9, 2022

Hello All,

I am new here and also using first time jira api, i need one help i'm trying to access jira api i.e. project exists or not using javascript code.

I run the api on postman and that's working fine but that dosen't working using javascript , 

can please anyone tell me what i did wrong , why its showing error 404.

 

 

2 answers

0 votes
ChandlerBing November 10, 2022

can please anyone share any blog about how to call jira api in JS code

0 votes
Fabio Racobaldo _Herzum_
Community Champion
November 9, 2022

Hi @ChandlerBing ,

welcome to the Atlassian community!

First of all please change the endpoint of the REST, it should be :

BASE_URL_OF_YOUR_INSTANCE/rest/api/3/project/{projectIdOrKey}

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-projectidorkey-get

In my opinion you should also remove the cookie from the header. If you read the following article https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html in the example just token need :

curl -H "Authorization: Bearer <yourToken>" https://{baseUrlOfYourInstance}/rest/api/content

Please let me know if it works.

Fabio

ChandlerBing November 9, 2022

Hi @Fabio Racobaldo _Herzum_ 

Thanks for your reply.

i try your suggestion but its not working, 

 

ChandlerBing November 10, 2022

any helps please @Fabio Racobaldo _Herzum_ 

Fabio Racobaldo _Herzum_
Community Champion
November 11, 2022

Hi @ChandlerBing ,

if you are on the cloud, why you have XXXXX/jira/XXXXX on the URL?

ChandlerBing November 11, 2022

Hi @Fabio Racobaldo _Herzum_ ,

 

yes it's on cloud , actully i'm trying to integrate jira with oracle apex , so jira have api that we check that if that project id exists or not , so i'm trying use fetch the data from that api and that api working fine on postman but i need to run that api through JS Code

Suggest an answer

Log in or Sign up to answer