-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AtlassianPS:master' into feature/IssueHistory
- Loading branch information
Showing
12 changed files
with
442 additions
and
8 deletions.
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
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# https://help.github.com/articles/about-codeowners/ | ||
.github/workflows @atlassianps/ci-managers | ||
JiraPS.build.ps1 @atlassianps/ci-managers | ||
PPSScriptAnalyzerSettings.psd1 @atlassianps/ci-managers | ||
Tools/ @atlassianps/ci-managers | ||
|
||
* @atlassianps/maintainers @atlassianps/reviewers | ||
* @atlassianps/maintainers |
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,16 @@ | ||
name: Refine PRs | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
label_issue: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Add default reviewers to PR" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
run: | | ||
gh pr edit $PR_URL --add-reviewer @atlassianps/reviewers |
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,66 @@ | ||
function Get-JiraIssueWorklog { | ||
# .ExternalHelp ..\JiraPS-help.xml | ||
[CmdletBinding()] | ||
param( | ||
[Parameter( Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName )] | ||
[ValidateNotNullOrEmpty()] | ||
[ValidateScript( | ||
{ | ||
if (("JiraPS.Issue" -notin $_.PSObject.TypeNames) -and (($_ -isnot [String]))) { | ||
$exception = ([System.ArgumentException]"Invalid Type for Parameter") #fix code highlighting] | ||
$errorId = 'ParameterType.NotJiraIssue' | ||
$errorCategory = 'InvalidArgument' | ||
$errorTarget = $_ | ||
$errorItem = New-Object -TypeName System.Management.Automation.ErrorRecord $exception, $errorId, $errorCategory, $errorTarget | ||
$errorItem.ErrorDetails = "Wrong object type provided for Issue. Expected [JiraPS.Issue] or [String], but was $($_.GetType().Name)" | ||
$PSCmdlet.ThrowTerminatingError($errorItem) | ||
<# | ||
#ToDo:CustomClass | ||
Once we have custom classes, this check can be done with Type declaration | ||
#> | ||
} | ||
else { | ||
return $true | ||
} | ||
} | ||
)] | ||
[Alias('Key')] | ||
[Object] | ||
$Issue, | ||
|
||
[Parameter()] | ||
[System.Management.Automation.PSCredential] | ||
[System.Management.Automation.Credential()] | ||
$Credential = [System.Management.Automation.PSCredential]::Empty | ||
) | ||
|
||
begin { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" | ||
} | ||
|
||
process { | ||
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] ParameterSetName: $($PsCmdlet.ParameterSetName)" | ||
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" | ||
|
||
# Find the proper object for the Issue | ||
$issueObj = Resolve-JiraIssueObject -InputObject $Issue -Credential $Credential | ||
|
||
$parameter = @{ | ||
URI = "{0}/worklog" -f $issueObj.RestURL | ||
Method = "GET" | ||
GetParameter = @{ | ||
maxResults = $PageSize | ||
} | ||
OutputType = "JiraWorklogItem" | ||
Paging = $true | ||
Credential = $Credential | ||
} | ||
|
||
Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" | ||
Invoke-JiraMethod @parameter | ||
} | ||
|
||
end { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" | ||
} | ||
} |
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
Oops, something went wrong.