Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Can't download the attachment from a Jira ticket with Powershell

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

2 answers

Did you have any luck with this mate?

Suggest an answer

Log in or Sign up to answer