-
-
Notifications
You must be signed in to change notification settings - Fork 130
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/issue history - make retrieval of history dependent on GetHistory argument/parameters switch #441
Open
GeekTieGuy
wants to merge
2
commits into
AtlassianPS:release/2.15-alpha
Choose a base branch
from
GeekTieGuy:feature/IssueHistory
base: release/2.15-alpha
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/issue history - make retrieval of history dependent on GetHistory argument/parameters switch #441
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function ConvertTo-JiraIssueHistoryEntry { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter( ValueFromPipeline )] | ||
[PSObject[]] | ||
$InputObject | ||
) | ||
|
||
process { | ||
foreach ($i in $InputObject) { | ||
Write-Debug "[$($MyInvocation.MyCommand.Name)] Converting `$InputObject to custom object" | ||
|
||
$props = @{ | ||
'ID' = $i.id | ||
'Author' = ConvertTo-JiraUser $i.author | ||
'Created' = Get-Date $i.created | ||
'Items' = $i.items | ||
} | ||
|
||
$result = New-Object -TypeName PSObject -Property $props | ||
$result.PSObject.TypeNames.Insert(0, 'JiraPS.IssueHistoryEntry') | ||
$result | Add-Member -MemberType ScriptMethod -Name 'ToString' -Force -Value { | ||
Write-Output "$($this.Id)" | ||
} | ||
|
||
Write-Output $result | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
function Get-JiraStatus { | ||
# .ExternalHelp ..\JiraPS-help.xml | ||
[CmdletBinding( DefaultParameterSetName = '_All' )] | ||
param( | ||
[Parameter( Mandatory, ValueFromPipeline, ParameterSetName = '_Search' )] | ||
[String[]] | ||
$IdOrName, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename variable to The documentations should elaborate on what values are allowed to be used for the parameter. |
||
|
||
[Parameter()] | ||
[System.Management.Automation.PSCredential] | ||
[System.Management.Automation.Credential()] | ||
$Credential = [System.Management.Automation.PSCredential]::Empty | ||
) | ||
|
||
begin { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" | ||
|
||
$server = Get-JiraConfigServer -ErrorAction Stop | ||
|
||
$resourceURi = "$server/rest/api/latest/status{0}" | ||
} | ||
|
||
process { | ||
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] ParameterSetName: $($PsCmdlet.ParameterSetName)" | ||
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" | ||
|
||
switch ($PSCmdlet.ParameterSetName) { | ||
'_All' { | ||
$parameter = @{ | ||
URI = $resourceURi -f "" | ||
Method = "GET" | ||
Credential = $Credential | ||
} | ||
Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" | ||
$result = Invoke-JiraMethod @parameter | ||
|
||
Write-Output (ConvertTo-JiraStatus -InputObject $result) | ||
} | ||
'_Search' { | ||
foreach ($item in $IdOrName) { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Processing [$item]" | ||
Write-Debug "[$($MyInvocation.MyCommand.Name)] Processing `$item [$item]" | ||
|
||
$parameter = @{ | ||
URI = $resourceURi -f "/$item" | ||
Method = "GET" | ||
Credential = $Credential | ||
} | ||
Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" | ||
$result = Invoke-JiraMethod @parameter | ||
|
||
Write-Output (ConvertTo-JiraStatus -InputObject $result) | ||
} | ||
} | ||
} | ||
} | ||
|
||
end { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is missing documentation
docs/en-US/commands/Get-JiraStatus.md
and testsTests/Functions/Get-JiraStatus.Unit.Tests.ps1
.