Note: I am using python.
I am trying to create an issue using the API that has a CSV file as an attachment.
I have done some research and it seems I need to create the issue, then update the issue and add the attachment.
I am able to create an issue with no problem. However, when I go to add the CSV file, I am getting a 404.
Here is my code for adding the csv to my issue. I store the id of the issue I created into a dataframe. My auth is correct - I have just ommitted it for this post.
files = {'file': open('myfile.csv', 'rb')}
url="https://mydomain.atlassian.net/rest/api/2/"+str(df.iloc[0]['id'])+"/attachments"
headers = {
"Accept": "application/json",
"Content-Type": "multipart/form-data",
"X-Atlassian-Token": "no-check"
}
response = requests.request(
"POST",
url,
headers=headers,
auth=auth,
files=files
)
Any help would be greatly appreciated!