You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Im trying to create an attachment in Jira via API using this code but Im getting error 404 not found
const endpoint = `/rest/api/2/issue/${jiraIssue.key}/attachments`;
const FormData = require('form-data');
cy.fixture('../../'+filePath, 'binary').then((fileBin) => {
const blob = Cypress.Blob.binaryStringToBlob(fileBin);
const formData = new FormData();
formData.append('file', blob, { filename: 'issue.feature' });
for (let [key, value] of formData.entries()) {
console.log(key, value);
}
cy.request({
method: 'POST',
url: `${this.apiUrl}${endpoint}`, // baseUrl is prepend to URL
body: formData,
headers: {
Authorization: `Basic ${this.apiKey}`,
'Content-Type': 'text/plain',
'X-Atlassian-Token': 'no-check',
}
}).then(response => {
});
Hi @Roberto Teresa and welcome,
please take a look here https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post
it seems that you are using version 2 and not version 3.
Hope this helps,
Fabio
Nothing it didn't worked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Roberto Teresa the end poit should contain you instance URL. Something like : "https://XXXX.atlassian.net/jira/rest/api/3/issue/{issueIdOrKey}/attachments"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.