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
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.