Forums

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

Got HTTP error 400 trying to create issue from Jira Cloud REST API

Corentin Allemand
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 18, 2020

After looked how it works, why I was getting this error... I'm asking to you to tell me if I'm wrong.

I'm using my API to create Task and Bug from user's feedback form.

public async createJIRAIssue(payload: any): Promise<any> {

const authToken = Buffer
.from('my@email.com:my-token')
.toString('base64');

try {
const result = await axios.post('https://my-instance.atlassian.net/rest/api/3/issue', {
"fields": {
"project":
{
"key": "KY"
},
"summary": "REST ye merry gentlemen.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Bug"
}
}
});
return result;
} catch (e) {
logger.error('Error at FeedbackService/createFeedback: %s', JSON.stringify(e));
throw handleError(e, 2020);
}
}

I got Error: Request failed with status code 400

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events