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 :-) ,
Has anyone manged to download a file from a Jira issue using JirsPS- note I'm trying to do this in a JSM project?
This is the command I am running (I have got an authenticated session) :
Get-JiraIssue SD-35306 | Get-JiraIssueAttachment -FileName "*.txt" | Get-JiraIssueAttachmentFile -Path "C:\Scripts\AD_User_Updates\Working folder"
This is the result:
PS C:\Scripts\AD_User_Updates\Working folder> Get-JiraIssue SD-35306 | Get-JiraIssueAttachment -FileName "*.txt" | Get-JiraIssueAttachmentFile -Path "C:\Scripts\AD_User_Updates\Working folder" Invoke-JiraMethod : Server responsed with NotAcceptable At C:\Users\bakerc\Documents\WindowsPowerShell\Modules\JiraPS\2.14.7\JiraPS.psm1:1886 char:23 + $result = Invoke-JiraMethod @iwParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidResult: (:) [Invoke-JiraMethod], RuntimeException + FullyQualifiedErrorId : InvalidResponse.Status406,Invoke-JiraMethod True PS C:\Scripts\AD_User_Updates\Working folder>
Ok for those who are interested this is how you make it work - always the way after you post something you work it out :-)
$attachments = Get-JiraIssue SD-35306 | Get-JiraIssueAttachment -FileName "*.txt"
foreach ($attachment in $attachments)
{
$path = 'C:\Scripts\AD_User_Updates\Working folder\' + $attachment.FileName
Invoke-JiraMethod -URI $attachment.content -OutFile $path
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.