The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events