Skip to content
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

Change "Issue" parameter of "Add-JiraIssueAttachment" to accept pipeline input #208

Open
arestarh opened this issue Dec 1, 2017 · 5 comments

Comments

@arestarh
Copy link

arestarh commented Dec 1, 2017

Expected Behavior

"Add-JiraIssueAttachment" cmdlet should accept pipeline input, but for "Issue" parameter, according to 'Get-Help Add-JiraIssueAttachment -Full', "Accept pipeline input? false".

Current Behavior

"Add-JiraIssueAttachment" cmdlet does not accept pipeline input.

Possible Solution

Extend parameter block of "Issue" parameter to accept pipeline input.

Steps to Reproduce (for bugs)

Context

Your Environment

Get-Module JiraPS -ListAvailable | select version
$PSVersionTable
@lipkau
Copy link
Member

lipkau commented Dec 1, 2017

Please explain the use case.

When do you want to attach the same file (s) to multiple issues?

@arestarh arestarh changed the title Change "Issue" parameter of "Add-JiraIssueAttachment" to accept pipeline input Change behavior of "Add-JiraIssueAttachment" to accept pipeline input Dec 1, 2017
@arestarh
Copy link
Author

arestarh commented Dec 1, 2017

I have a .csv file with info for several issues. For each issue I have separate file to attach.
I've just sent issue object to "Add-JiraIssueAttachment" cmdlet via pipeline, because I read about this possibility in examples. No special reason, just it's comfortable for me to use pipeline in this case.

@lipkau
Copy link
Member

lipkau commented Dec 1, 2017

The file should be accepted in the pipeline. Not the issue.
Maybe the example is wrong.

Well... I need to check if PS can differentiate between to pipeline parameter if one is a PSObject.
If so, I'll add this in the next minor release
If not, it will have to wait for the custom object...

@lipkau lipkau changed the title Change behavior of "Add-JiraIssueAttachment" to accept pipeline input Change "Issue" parameter of "Add-JiraIssueAttachment" to accept pipeline input Dec 1, 2017
@lipkau
Copy link
Member

lipkau commented Dec 1, 2017

Tested...

It does work... but the type declaration of the -FilePath would have change to [System.IO.FileInfo] -> which would be a breaking change
Therefore the following are possible:

  • Use Get-JiraIssue Foo-1234 | {Add-JiraIssueAttachment -Issue $_ -File "c;\temp\file.ini"} as a workaround
  • Change the type of FilePath
    • this would make the parameter to be renamed --> would be good to evaluate other cmdlets and see how they did it
    • which will take a while
  • Wait until [JiraPS.Issue] has a class for itself
    • which will take a while
    • would be good to evaluate if it would make sense to change -FilePath to a [System.IO.FileInfo] as well

If anyone can think of another alternative, please share

@arestarh
Copy link
Author

arestarh commented Dec 1, 2017

Mentioned workaround sounds good to me. Thanks.

@lipkau lipkau added this to the v3.0 milestone Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants