It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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)

1 answer

0 votes

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

880 views 7 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you