Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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 not download a file using JiraPS (ATLASSIANPS)

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> 
Any ideas on what I need to do to get it to work? (

1 answer

1 accepted

0 votes
Answer accepted

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
}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events