Hi,
I would like to download the attachment from a Jira ticket using the command
Get-JiraIssueAttachment -issue $Request | get-jiraissueattachmentfile -path $path"
but I got the error
--------------------------------------------------------
Invoke-JiraMethod : Server responsed with NotAcceptable
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.14.6\JiraPS.psm1:1886 char:23
+ $result = Invoke-JiraMethod @iwParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Invoke-JiraMethod], RuntimeException
+ FullyQualifiedErrorId : InvalidResponse.Status406,Invoke-JiraMethod
--------------------------------------------------------
I know it is error 406 that something to do with the proxy/firewall. So, I'd like to get around by using:
-------------------------------------------------------
Invoke-JiraMethod -Uri (Get-JiraIssueAttachment -Issue $request).content[0] -OutFile $path.$request.txt
------------------------------------------------------
but then I got another error
------------------------------------------------------
Invoke-JiraMethod : Cannot process argument transformation on parameter 'URI'. Cannot convert value "h" to type "System.Uri". Error: "Invalid cast from
'System.Char' to 'System.Uri'."
At line:1 char:24
+ ... Method -Uri (Get-JiraIssueAttachment -Issue $request).content[0] -Out ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-JiraMethod], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Invoke-JiraMethod
------------------------------------------------------
The attachment is a simple CSV file, so I don't know what is going on. So strange that if the attachment is a TXT file, sometimes it can get through.
Please help.
Regards
Jason
Hi @Jason Chan , if you are still interested I worked it out here:
https://community.atlassian.com/t5/Jira-Software-questions/Can-not-download-a-file-using-JiraPS-ATLASSIANPS/qaq-p/2507223#U2507238
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.