-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Attachments #137
Comments
thanks for making that quick :) |
please note: any contribution is welcome. Not all listed APIs/functions must be implemented at the same time. |
|
@lipkau, |
Add-JiraAttachment -Issue 'FOO-1234' -FilePath 'C:\file.txt' |
@lipkau, |
No. |
:) Thanks Oliver, looking forward to having this feature, need help developing it? :) |
Yes. That's what the |
I would suggest taking a look at this super helpful post on multi part uploads: http://blog.majcica.com/2016/01/13/powershell-tips-and-tricks-multipartform-data-requests/ Author wrote a Invoke-MultipartFormDataUpload function which appears to fulfill the rest api's requirement for rfc 1867 content format. I think this would fit best as an appendex to Invoke-JiraMethod, since that itself is a wrapper for Invoke-WebRequest. The Invoke-MultipartFormDataUpload would appear to suppliment the base function of iwr, so it would make sense that the jira specific wrapper for iwr would have this capability to enhance iwr (within the wrapper) From there, several different type of "helpers" to feed invoke-webrequest with the multipart method could be written for file uploads and avatars for jira. Confluence/PS would benefit from this same enhancement. |
@beaudryj already has some working code. |
FEATURES: - `Add-JiraIssueAttachment`: Add an attachment to an issue (#137, [@beaudryj][]) - `Get-JiraIssueAttachment`: Get attachments from issues (#137, [@beaudryj][]) - `Remove-JiraIssueAttachment`: Remove attachments from issues (#137, [@beaudryj][]) IMPROVEMENTS: - `JiraPS.Issue` now has a property for Attachments `JiraPS.Attachment` (#137, [@beaudryj][])
api/2/attachment
Add Attahment
Add-JiraAttachment
Upload a local file to the server and attach it to an Issue
POST /rest/api/2/issue/{issueIdOrKey}/attachments
Parameter
-Issue
int / PSJira.Issue mandatory-FilePath
string / FileInfo mandatoryHelpful links
-F
. Documented heremultipart/form-data
using powershellOutput
Get an Attachment from an Issue
Attachment
of typePSJira.Attachment
Remove an Attachment
Remove-JiraAttachment
Remove an Attachment from the server
DELETE /rest/api/2/attachment/{id}
Parameter
-Id
integer / PSJira.Attachement mandatory - ValueFromPipeline, ValueFromPipelineByPropertyNameOutput
The text was updated successfully, but these errors were encountered: