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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.