Forums

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

Create a JIRA issue with a POST call and a JSON body from a browser

Christos Palaskas October 23, 2020

I've been trying to create a JIRA issue using the API. I can do it succesfully from Postman or with CURL from a terminal but not when I use Angular and the HttpClient.

I have read a lot of the questions and answers from other users, to no avail.

First problem is I have to manually allow Access control origin on my browser.

Then I get a 403 error"XSRF check failed"

If I follow the suggestion of a thread with the same problem and disable the User Agent of my browser I get a 400 error: {project: "project is required"}, meaning probably that the JSON string was not parsed properly.

I tried with username:pass and email:API Key, with the same results.

I also tried 'X-Atlassian-Token': 'nocheck' on the header as well as other values that I see on Postman. 

I also tried some Jira API wrappers for JS/TS but my typescript version was not compatible. I am running out of options, and any help would be appreciated.

1 answer

0 votes
Warren
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.
October 26, 2020

Hi @Christos Palaskas 

You need to use the email:API token combination, which is (I'm assuming) what worked in Postman. You need to 64 bit encode that combination, which you may not see happening in Postman - hopefully that will get you at least a step closer to successfully POSTing

Christos Palaskas October 26, 2020

@Warren thank you for the quick response. Unfortunately I have been using a 64 bit encoding on the email:API key combination but still get the error "XSRF check failed".

'Authorization': 'Basic ' + btoa('name@email:XXXXXXXXXXXXXXXXX')

Is it possible to pursue a Jira authentication popup window were the user can enter their credentials and receive a token?

Christos Palaskas October 26, 2020

At phase one I am trying to access JIRA through the API from the browser, even with hardcoded passwords or API keys. I just need a proof of concept, the minimal way to make it work.

I am trying to follow this docu:
https://developer.atlassian.com/server/jira/platform/oauth/

but I get a different popup. Am I on the right path at all?

createOAUTH.JPG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events