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

Fix issue 229 - New-JiraIssue should take params from pipeline. #312

Merged
merged 3 commits into from
Sep 21, 2018

Conversation

ctolan
Copy link
Contributor

@ctolan ctolan commented Sep 21, 2018

Description

The here was due to how PowerShell handles input via the pipeline, see an in depth explanation with examples here: https://learn-powershell.net/2013/05/07/tips-on-implementing-pipeline-support/.
The function will be unable to use $Profile in the begin block, so i moved that code into the Process block. This is necessary so that multiple new issues can be passed in and processed one after the other.

Motivation and Context

This resolves #229 and allows a user to fill an excel sheet or other object with new issues and pipe them into new issue.
closes #229

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have added Pester Tests that describe what my changes should do.
  • I have updated the documentation accordingly.

Issue was due to begin and end blocks using params.
Added test for params from pipeline.
@ctolan ctolan requested review from a team as code owners September 21, 2018 21:16
@ghost ghost added the Status:In Review label Sep 21, 2018
Copy link
Member

@lipkau lipkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job.
Please fix the two comments and I will merge

[PSCustomObject]
$Fields,

[Parameter()]
[Parameter( ValueFromPipelineByPropertyName )]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credential is not part of any object that can be used in the pipeline.
please remove this change

[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential = [System.Management.Automation.PSCredential]::Empty
)

begin {
}

process {
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the Write-Verbose of the beginning in the begin block

Removed credential from param by pipeline.
@lipkau lipkau merged commit fbd7100 into AtlassianPS:develop Sep 21, 2018
@ghost ghost removed the Status:In Review label Sep 21, 2018
@lipkau lipkau mentioned this pull request Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants