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: 
  • Community
  • Q&A
  • Jira
  • Questions
  • How to resolve 'The remote server returned an error: (404) Not Found' error while uploading JIRA?

How to resolve 'The remote server returned an error: (404) Not Found' error while uploading JIRA?

Sai Krishna
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!
May 15, 2018

We are receiving the below error when we try to upload a .csv file to an already existing JIRA ticket. The ID which we are using has the necessary privilege to create and update JIRA tickets.

 

Error message: Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found.".Exception.Message
 Exception Item : Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found.".Exception.ItemName

 

We are calling rest api using the below PowerShell script:

 

Param($JiraUserId,$DecryptedPassword,$JiraTicket,$Filepath,$JiraURL)

 

Try { $Url=$JiraURL $UserID=$JiraUserId

$Password=$DecryptedPassword

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("

{0}:{1}"

-f  $UserID, $Password)))

$headers = New-Object

"System.Collections.Generic.Dictionary[[String],[String]]"

$headers.Add('Authorization',('Basic {0}

' -f $base64AuthInfo))

$headers.Add('Accept','application/json')

$headers.Add('Content-Type','application/json') $JiraRest = new-object

System.Net.WebClient $JiraRest.Headers.Add("Authorization",

$headers.Authorization) $JiraRest.Headers.Add("X-Atlassian-Token",

"nocheck") $UploadState=$JiraRest.UploadFile("$Url/$JiraTicket/attachments",

$Filepath)

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Taranjeet Singh
Community Champion
December 19, 2019

@Sai Krishna Any updates on your issue is resolved or not?

0 votes
Taranjeet Singh
Community Champion
October 16, 2019

@Sai Krishna Can you check if the JIRA user with which you are attempting this, has "Create Attachments" permission in the relevant JIRA project?