From df3980595220386644d8b1d504dddc0b2d77ca70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Por=C4=99ba?= Date: Wed, 9 Jan 2019 08:30:54 +0000 Subject: [PATCH 01/20] fixes 320 - assignment when similar users exist --- JiraPS/Public/Get-JiraUser.ps1 | 7 +++++-- JiraPS/Public/Set-JiraIssue.ps1 | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/JiraPS/Public/Get-JiraUser.ps1 b/JiraPS/Public/Get-JiraUser.ps1 index 640517ce..66ed850d 100644 --- a/JiraPS/Public/Get-JiraUser.ps1 +++ b/JiraPS/Public/Get-JiraUser.ps1 @@ -27,7 +27,9 @@ function Get-JiraUser { [Parameter()] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] - $Credential = [System.Management.Automation.PSCredential]::Empty + $Credential = [System.Management.Automation.PSCredential]::Empty, + + [Switch]$Exact ) begin { @@ -37,6 +39,7 @@ function Get-JiraUser { $selfResourceUri = "$server/rest/api/latest/myself" $searchResourceUri = "$server/rest/api/latest/user/search?username={0}" + $exactResourceUri = "$server/rest/api/latest/user?username={0}" if ($IncludeInactive) { $searchResourceUri += "&includeInactive=true" @@ -80,7 +83,7 @@ function Get-JiraUser { $PsCmdlet.ParameterSetName = "ByUserName" } "ByUserName" { - $resourceURi = $searchResourceUri + $resourceURi = if ($Exact) { $exactResourceUri } else { $searchResourceUri } foreach ($user in $UserName) { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Processing [$user]" diff --git a/JiraPS/Public/Set-JiraIssue.ps1 b/JiraPS/Public/Set-JiraIssue.ps1 index 2dfb465e..01bce57c 100644 --- a/JiraPS/Public/Set-JiraIssue.ps1 +++ b/JiraPS/Public/Set-JiraIssue.ps1 @@ -96,7 +96,7 @@ function Set-JiraIssue { $validAssignee = $true } else { - if ($assigneeObj = Get-JiraUser -UserName $Assignee -Credential $Credential) { + if ($assigneeObj = Get-JiraUser -UserName $Assignee -Credential $Credential -Exact) { Write-Debug "[$($MyInvocation.MyCommand.Name)] User found (name=[$($assigneeObj.Name)],RestUrl=[$($assigneeObj.RestUrl)])" $assigneeString = $assigneeObj.Name $validAssignee = $true From 6e38104bf2f1ac8e257e053fd74b4ed7b8c9a0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Por=C4=99ba?= Date: Wed, 9 Jan 2019 09:04:55 +0000 Subject: [PATCH 02/20] -Exact for Get-JiraUser --- JiraPS/Public/Get-JiraUser.ps1 | 1 + Tests/Functions/Get-JiraUser.Unit.Tests.ps1 | 16 ++++++++++++++++ docs/en-US/commands/Get-JiraUser.md | 12 ++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/JiraPS/Public/Get-JiraUser.ps1 b/JiraPS/Public/Get-JiraUser.ps1 index 66ed850d..5a8be9d3 100644 --- a/JiraPS/Public/Get-JiraUser.ps1 +++ b/JiraPS/Public/Get-JiraUser.ps1 @@ -29,6 +29,7 @@ function Get-JiraUser { [System.Management.Automation.Credential()] $Credential = [System.Management.Automation.PSCredential]::Empty, + [Parameter()] [Switch]$Exact ) diff --git a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 index cd09868c..25df25d6 100644 --- a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 +++ b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 @@ -108,6 +108,12 @@ Describe "Get-JiraUser" -Tag 'Unit' { ConvertFrom-Json -InputObject $restResult } + # Get exact user + Mock Invoke-JiraMethod -ModuleName JiraPS -ParameterFilter {$Method -eq 'Get' -and $URI -like "$jiraServer/rest/api/*/user?username=$testUsername"} { + ShowMockInfo 'Invoke-JiraMethod' 'Method', 'Uri' + ConvertFrom-Json -InputObject $restResult + } + # Viewing a specific user. The main difference here is that this includes groups, and the first does not. Mock Invoke-JiraMethod -ModuleName JiraPS -ParameterFilter {$Method -eq 'Get' -and $URI -like "$jiraServer/rest/api/*/user?username=$testUsername&expand=groups"} { ShowMockInfo 'Invoke-JiraMethod' 'Method', 'Uri' @@ -138,6 +144,16 @@ Describe "Get-JiraUser" -Tag 'Unit' { $getResult | Should Not BeNullOrEmpty + Assert-MockCalled -CommandName Invoke-JiraMethod -Exactly 1 -Scope It -ParameterFilter {$URI -like "$jiraServer/rest/api/*/user/search?*username=$testUsername*"} { + Assert-MockCalled -CommandName Invoke-JiraMethod -Exactly 1 -Scope It -ParameterFilter {$URI -like "$jiraServer/rest/api/*/user?username=$testUsername&expand=groups"} + } + + It "Gets information about a provided Jira exact user" { + $getResult = Get-JiraUser -UserName $testUsername + + $getResult | Should Not BeNullOrEmpty + + Assert-MockCalled -CommandName Invoke-JiraMethod -Exactly 1 -Scope It -ParameterFilter {$Method -eq 'Get' -and $URI -like "$jiraServer/rest/api/*/user?username=$testUsername"} Assert-MockCalled -CommandName Invoke-JiraMethod -Exactly 1 -Scope It -ParameterFilter {$URI -like "$jiraServer/rest/api/*/user?username=$testUsername&expand=groups"} } diff --git a/docs/en-US/commands/Get-JiraUser.md b/docs/en-US/commands/Get-JiraUser.md index 76d9d06c..9167e5a5 100644 --- a/docs/en-US/commands/Get-JiraUser.md +++ b/docs/en-US/commands/Get-JiraUser.md @@ -24,7 +24,7 @@ Get-JiraUser [-Credential ] [] ### ByUserName ```powershell -Get-JiraUser [-UserName] [-IncludeInactive] [[-MaxResults] ] [[-Skip] ] [-Credential ] [] +Get-JiraUser [-UserName] [-IncludeInactive] [[-MaxResults] ] [[-Skip] ] [-Credential ] [-Exact] [] ``` ### ByInputObject @@ -45,7 +45,7 @@ This function returns information regarding a specified user from Jira. Get-JiraUser -UserName user1 ``` -Returns information about the user user1 +Returns information about all users with username like user1 ### EXAMPLE 2 @@ -63,6 +63,14 @@ Get-JiraUser -Credential $cred This example returns the JIRA user that is executing the command. +### EXAMPLE 4 + +```powershell +Get-JiraUser -UserName user1 -Exact +``` + +Returns information about user user1 + ## PARAMETERS ### -UserName From fd6f3a1e0b964b8b2df5c7262205517d5c54f272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Por=C4=99ba?= Date: Wed, 9 Jan 2019 10:28:51 +0000 Subject: [PATCH 03/20] missing } --- Tests/Functions/Get-JiraUser.Unit.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 index 25df25d6..e8b975df 100644 --- a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 +++ b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 @@ -144,7 +144,7 @@ Describe "Get-JiraUser" -Tag 'Unit' { $getResult | Should Not BeNullOrEmpty - Assert-MockCalled -CommandName Invoke-JiraMethod -Exactly 1 -Scope It -ParameterFilter {$URI -like "$jiraServer/rest/api/*/user/search?*username=$testUsername*"} { + Assert-MockCalled -CommandName Invoke-JiraMethod -Exactly 1 -Scope It -ParameterFilter {$URI -like "$jiraServer/rest/api/*/user/search?*username=$testUsername*"} Assert-MockCalled -CommandName Invoke-JiraMethod -Exactly 1 -Scope It -ParameterFilter {$URI -like "$jiraServer/rest/api/*/user?username=$testUsername&expand=groups"} } From eb8c09a6410c8cc30b32478e5dd94f0088c3bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Por=C4=99ba?= Date: Thu, 10 Jan 2019 07:40:08 +0000 Subject: [PATCH 04/20] adding documentation to Get-JiraUser -Exact --- docs/en-US/commands/Get-JiraUser.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en-US/commands/Get-JiraUser.md b/docs/en-US/commands/Get-JiraUser.md index 9167e5a5..179f81f1 100644 --- a/docs/en-US/commands/Get-JiraUser.md +++ b/docs/en-US/commands/Get-JiraUser.md @@ -30,7 +30,7 @@ Get-JiraUser [-UserName] [-IncludeInactive] [[-MaxResults] ] ### ByInputObject ```powershell -Get-JiraUser [-InputObject] [-IncludeInactive] [-Credential ] [] +Get-JiraUser [-InputObject] [-IncludeInactive] [-Credential ] [-Exact] [] ``` ## DESCRIPTION From adf6e40b7cee913aa015bba3ade609957dae5fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Por=C4=99ba?= Date: Thu, 10 Jan 2019 07:40:59 +0000 Subject: [PATCH 05/20] fixing Get-JiraUser -Exact unit test --- Tests/Functions/Get-JiraUser.Unit.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 index e8b975df..d8a13a43 100644 --- a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 +++ b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 @@ -149,7 +149,7 @@ Describe "Get-JiraUser" -Tag 'Unit' { } It "Gets information about a provided Jira exact user" { - $getResult = Get-JiraUser -UserName $testUsername + $getResult = Get-JiraUser -UserName $testUsername -Exact $getResult | Should Not BeNullOrEmpty From acff336ae3bcd16d70f16579066c8f84a723d215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Por=C4=99ba?= Date: Thu, 10 Jan 2019 07:42:20 +0000 Subject: [PATCH 06/20] Exact in Get-JiraUser is not applicable for -Self set --- JiraPS/Public/Get-JiraUser.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/JiraPS/Public/Get-JiraUser.ps1 b/JiraPS/Public/Get-JiraUser.ps1 index 5a8be9d3..8c6b8a0b 100644 --- a/JiraPS/Public/Get-JiraUser.ps1 +++ b/JiraPS/Public/Get-JiraUser.ps1 @@ -29,7 +29,8 @@ function Get-JiraUser { [System.Management.Automation.Credential()] $Credential = [System.Management.Automation.PSCredential]::Empty, - [Parameter()] + [Parameter( ParameterSetName = 'ByInputObject' )] + [Parameter( ParameterSetName = 'ByUserName' )] [Switch]$Exact ) From 74a3f6156a2e13ef74470220180d4ab62fbf33f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Por=C4=99ba?= Date: Thu, 10 Jan 2019 08:01:15 +0000 Subject: [PATCH 07/20] trying to figure out the documentation requirements --- docs/en-US/commands/Get-JiraUser.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/en-US/commands/Get-JiraUser.md b/docs/en-US/commands/Get-JiraUser.md index 179f81f1..b07c710c 100644 --- a/docs/en-US/commands/Get-JiraUser.md +++ b/docs/en-US/commands/Get-JiraUser.md @@ -174,6 +174,20 @@ Accept pipeline input: False Accept wildcard characters: False ``` +```yaml +Type: SwitchParameter +Parameter Sets: ByUserName,ByInputObject +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + + + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. From 95d547497d09be34ede0a4ca776111fd99c007be Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 10 Jan 2019 17:08:48 +0100 Subject: [PATCH 08/20] Fixed documentation of new parameter --- JiraPS/Public/Get-JiraUser.ps1 | 10 ++++----- docs/en-US/commands/Get-JiraUser.md | 32 +++++++++++++++-------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/JiraPS/Public/Get-JiraUser.ps1 b/JiraPS/Public/Get-JiraUser.ps1 index 8c6b8a0b..aa18cc30 100644 --- a/JiraPS/Public/Get-JiraUser.ps1 +++ b/JiraPS/Public/Get-JiraUser.ps1 @@ -11,6 +11,10 @@ function Get-JiraUser { [Parameter( Position = 0, Mandatory, ParameterSetName = 'ByInputObject' )] [Object[]] $InputObject, + [Parameter( ParameterSetName = 'ByInputObject' )] + [Parameter( ParameterSetName = 'ByUserName' )] + [Switch]$Exact, + [Switch] $IncludeInactive, @@ -27,11 +31,7 @@ function Get-JiraUser { [Parameter()] [System.Management.Automation.PSCredential] [System.Management.Automation.Credential()] - $Credential = [System.Management.Automation.PSCredential]::Empty, - - [Parameter( ParameterSetName = 'ByInputObject' )] - [Parameter( ParameterSetName = 'ByUserName' )] - [Switch]$Exact + $Credential = [System.Management.Automation.PSCredential]::Empty ) begin { diff --git a/docs/en-US/commands/Get-JiraUser.md b/docs/en-US/commands/Get-JiraUser.md index b07c710c..fa55f7eb 100644 --- a/docs/en-US/commands/Get-JiraUser.md +++ b/docs/en-US/commands/Get-JiraUser.md @@ -66,7 +66,7 @@ This example returns the JIRA user that is executing the command. ### EXAMPLE 4 ```powershell -Get-JiraUser -UserName user1 -Exact +Get-JiraUser -UserName user1 -Exact ``` Returns information about user user1 @@ -105,6 +105,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Exact + +Limits the search to users where the username is exactly the term searched for. + +```yaml +Type: Switch +Parameter Sets: ByUserName, ByInputObject +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -IncludeInactive Include inactive users in the search @@ -174,20 +190,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -```yaml -Type: SwitchParameter -Parameter Sets: ByUserName,ByInputObject -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - - - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. From d21c011da56423e358d1f4bc4bbdfbbdfa1548d5 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 10 Jan 2019 17:24:02 +0100 Subject: [PATCH 09/20] Added description of implementation to CHANGELOG --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b51ccb21..6a53cd0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [NEXT VERSION] - YYYY-MM-DD + +### Added + +- Parameter for retrieving information about a specific user with `Get-JiraUser` (#328, [@michalporeba]) + - this implementations will be changed with the next major update in favor of #306 + ## [2.9] - 2018-12-12 ### Added @@ -21,7 +28,6 @@ - Fixed missing properties on `Get-JiraUser` (#321, [@lipkau]) - Fixed `-DateStarted` on `Add-JiraIssueWorklog` (#324, [@lipkau]) - ## [2.8] - 2018-06-28 More detailed description about the changes can be found on [Our Website](https://atlassianps.org/article/announcement/JiraPS-v2.8.html). @@ -311,6 +317,7 @@ which is in turn inspired by the [Vagrant](https://github.com/mitchellh/vagrant/ [@LiamLeane]: https://github.com/LiamLeane [@lipkau]: https://github.com/lipkau [@lukhase]: https://github.com/lukhase + [@michalporeba]: https://github.com/michalporeba [@padgers]: https://github.com/padgers [@ThePSAdmin]: https://github.com/ThePSAdmin [@tuxgoose]: https://github.com/tuxgoose From 9db4972202a50cf3ca4d33bcead751aff4f0fa96 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Fri, 11 Jan 2019 09:44:40 +0100 Subject: [PATCH 10/20] Fixed logic of how to retrieve components from project Logic for retrieving components from project now works fine for Project objects over the pipeline --- JiraPS/Public/Get-JiraComponent.ps1 | 32 +++++++++++++---------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/JiraPS/Public/Get-JiraComponent.ps1 b/JiraPS/Public/Get-JiraComponent.ps1 index 4374669b..57a9735d 100644 --- a/JiraPS/Public/Get-JiraComponent.ps1 +++ b/JiraPS/Public/Get-JiraComponent.ps1 @@ -56,26 +56,22 @@ function Get-JiraComponent { switch ($PSCmdlet.ParameterSetName) { "ByProject" { - if ($Project.PSObject.TypeNames -contains 'JiraPS.Project') { - Write-Output (Get-JiraComponent -ComponentId ($Project.Components).id) - } - else { - foreach ($_project in $Project) { - Write-Verbose "[$($MyInvocation.MyCommand.Name)] Processing [$_project]" - Write-Debug "[$($MyInvocation.MyCommand.Name)] Processing `$_project [$_project]" - - if ($_project -is [string]) { - $parameter = @{ - URI = $resourceURi -f "/project/$_project/components" - Method = "GET" - Credential = $Credential - } - Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" - $result = Invoke-JiraMethod @parameter + foreach ($_project in $Project) { + Write-Verbose "[$($MyInvocation.MyCommand.Name)] Processing [$_project]" + Write-Debug "[$($MyInvocation.MyCommand.Name)] Processing `$_project [$_project]" - Write-Output (ConvertTo-JiraComponent -InputObject $result) - } + if ($_project -isnot [string]) { + $_project = $_project.Key } + $parameter = @{ + URI = $resourceURi -f "/project/$_project/components" + Method = "GET" + Credential = $Credential + } + Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" + $result = Invoke-JiraMethod @parameter + + Write-Output (ConvertTo-JiraComponent -InputObject $result) } } "ByID" { From c6c21df081ca23d0e97be89c44eb5b50e4936dbf Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Fri, 11 Jan 2019 10:09:41 +0100 Subject: [PATCH 11/20] Removed debug messages from test file --- Tests/Functions/Get-JiraIssueAttachmentFile.Unit.Tests.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/Functions/Get-JiraIssueAttachmentFile.Unit.Tests.ps1 b/Tests/Functions/Get-JiraIssueAttachmentFile.Unit.Tests.ps1 index eeb9863f..a3d0b2e3 100644 --- a/Tests/Functions/Get-JiraIssueAttachmentFile.Unit.Tests.ps1 +++ b/Tests/Functions/Get-JiraIssueAttachmentFile.Unit.Tests.ps1 @@ -122,7 +122,6 @@ Describe "Get-JiraIssueAttachmentFile" -Tag 'Unit' { } It 'uses Invoke-JiraMethod for saving to disk' { - $script:ShowMockData = $true Get-JiraIssueAttachment -Issue "Foo" | Get-JiraIssueAttachmentFile Get-JiraIssueAttachment -Issue "Foo" | Get-JiraIssueAttachmentFile -Path "../" From ef1034f62b40d5992376195e6eba0c2d49389832 Mon Sep 17 00:00:00 2001 From: Tim Howes Date: Tue, 22 Jan 2019 16:43:08 +0000 Subject: [PATCH 12/20] Fix setting Accept header based on Mime time of attachment --- JiraPS/Public/Get-JiraIssueAttachmentFile.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JiraPS/Public/Get-JiraIssueAttachmentFile.ps1 b/JiraPS/Public/Get-JiraIssueAttachmentFile.ps1 index 4021a752..e56cf81b 100644 --- a/JiraPS/Public/Get-JiraIssueAttachmentFile.ps1 +++ b/JiraPS/Public/Get-JiraIssueAttachmentFile.ps1 @@ -52,7 +52,7 @@ function Get-JiraIssueAttachmentFile { $iwParameters = @{ Uri = $_Attachment.Content Method = 'Get' - Headers = @{"Accept" = $_Attachment.MediaType} + Headers = @{"Accept" = $_Attachment.MimeType} OutFile = $filename Credential = $Credential } From 53476e75fcc9607566309d21c291549d5a8913be Mon Sep 17 00:00:00 2001 From: Joel Nolan Date: Fri, 15 Feb 2019 14:08:25 -0800 Subject: [PATCH 13/20] ** Modify ConvertTo-JiraProject to additionally store the 'style' value returned - for use with differentiating between classic and 'next-gen' Jira projects --- JiraPS/Private/ConvertTo-JiraProject.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/JiraPS/Private/ConvertTo-JiraProject.ps1 b/JiraPS/Private/ConvertTo-JiraProject.ps1 index 24f49e32..5b84ab01 100644 --- a/JiraPS/Private/ConvertTo-JiraProject.ps1 +++ b/JiraPS/Private/ConvertTo-JiraProject.ps1 @@ -20,6 +20,7 @@ function ConvertTo-JiraProject { 'Roles' = $i.roles 'RestUrl' = $i.self 'Components' = $i.components + 'Style' = $i.style } if ($i.projectCategory) { From 89e61fa73519d5d83b2e660d8d238f2b86303056 Mon Sep 17 00:00:00 2001 From: Joel Nolan Date: Fri, 15 Feb 2019 14:10:41 -0800 Subject: [PATCH 14/20] ** Modify Get-JiraIssueCreateMetadata and New-JiraIssue to do proper error handling when the input IssueType value is not valid for the input Project value ** Modify Get-JiraIssueCreateMetadata and New-JiraIssue to use data already returned from Get-JiraProject, saving an API call and some filtering work in Get-JiraIssueType --- JiraPS/Public/Get-JiraIssueCreateMetadata.ps1 | 12 +++++++++++- JiraPS/Public/New-JiraIssue.ps1 | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/JiraPS/Public/Get-JiraIssueCreateMetadata.ps1 b/JiraPS/Public/Get-JiraIssueCreateMetadata.ps1 index f1a03ab0..8e1b05c8 100644 --- a/JiraPS/Public/Get-JiraIssueCreateMetadata.ps1 +++ b/JiraPS/Public/Get-JiraIssueCreateMetadata.ps1 @@ -29,7 +29,17 @@ function Get-JiraIssueCreateMetadata { Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" $projectObj = Get-JiraProject -Project $Project -Credential $Credential -ErrorAction Stop - $issueTypeObj = Get-JiraIssueType -IssueType $IssueType -Credential $Credential -ErrorAction Stop + $issueTypeObj = $projectObj.IssueTypes | Where-Object -FilterScript {$_.Id -eq $IssueType -or $_.Name -eq $IssueType} + + if ($null -eq $issueTypeObj.Id) + { + $errorMessage = @{ + Category = "InvalidResult" + CategoryActivity = "Validating parameters" + Message = "No issue types were found in the project [$Project] for the given issue type [$IssueType]. Use Get-JiraIssueType for more details." + } + Write-Error @errorMessage + } $parameter = @{ URI = $resourceURi -f $projectObj.Id, $issueTypeObj.Id diff --git a/JiraPS/Public/New-JiraIssue.ps1 b/JiraPS/Public/New-JiraIssue.ps1 index 53751b6d..8bf18f57 100644 --- a/JiraPS/Public/New-JiraIssue.ps1 +++ b/JiraPS/Public/New-JiraIssue.ps1 @@ -66,7 +66,17 @@ function New-JiraIssue { Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" $ProjectObj = Get-JiraProject -Project $Project -Credential $Credential -ErrorAction Stop -Debug:$false - $IssueTypeObj = Get-JiraIssueType -IssueType $IssueType -Credential $Credential -ErrorAction Stop -Debug:$false + $issueTypeObj = $projectObj.IssueTypes | Where-Object -FilterScript {$_.Id -eq $IssueType -or $_.Name -eq $IssueType} + + if ($null -eq $issueTypeObj.Id) + { + $errorMessage = @{ + Category = "InvalidResult" + CategoryActivity = "Validating parameters" + Message = "No issue types were found in the project [$Project] for the given issue type [$IssueType]. Use Get-JiraIssueType for more details." + } + Write-Error @errorMessage + } $requestBody = @{ "project" = @{"id" = $ProjectObj.Id} @@ -85,6 +95,10 @@ function New-JiraIssue { if ($PSCmdlet.MyInvocation.BoundParameters.ContainsKey("Reporter")) { $requestBody["reporter"] = @{"name" = "$Reporter"} } + elseif ($ProjectObj.Style -eq "next-gen"){ + Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Adding reporter as next-gen projects must have reporter set." + $requestBody["reporter"] = @{"name" = "$((Get-JiraUser -UserName ((Get-JiraSession).UserName)).Name)"} + } if ($Parent) { $requestBody["parent"] = @{"key" = $Parent} From 51d5d46a49b3638161a522839261c4b8e33c5879 Mon Sep 17 00:00:00 2001 From: Joel Nolan Date: Fri, 15 Feb 2019 14:58:47 -0800 Subject: [PATCH 15/20] ** Update unit tests for Get-JiraIssueCreateMetadata and New-JiraIssue to support their usage of IssueTypes data returned from Get-JiraProject --- .../Get-JiraIssueCreateMetadata.Unit.Tests.ps1 | 15 ++++++--------- Tests/Functions/New-JiraIssue.Unit.Tests.ps1 | 15 +++++++-------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Tests/Functions/Get-JiraIssueCreateMetadata.Unit.Tests.ps1 b/Tests/Functions/Get-JiraIssueCreateMetadata.Unit.Tests.ps1 index 8562c198..c8cbdc75 100644 --- a/Tests/Functions/Get-JiraIssueCreateMetadata.Unit.Tests.ps1 +++ b/Tests/Functions/Get-JiraIssueCreateMetadata.Unit.Tests.ps1 @@ -218,23 +218,20 @@ Describe "Get-JiraIssueCreateMetadata" -Tag 'Unit' { } Mock Get-JiraProject -ModuleName JiraPS { + $issueObject = [PSCustomObject] @{ + ID = 2 + Name = 'Test Issue Type' + } + $issueObject.PSObject.TypeNames.Insert(0, 'JiraPS.IssueType') $object = [PSCustomObject] @{ ID = 10003 Name = 'Test Project' } + Add-Member -InputObject $object -MemberType NoteProperty -Name "IssueTypes" -Value $issueObject $object.PSObject.TypeNames.Insert(0, 'JiraPS.Project') return $object } - Mock Get-JiraIssueType -ModuleName JiraPS { - $object = [PSCustomObject] @{ - ID = 2 - Name = 'Test Issue Type' - } - $object.PSObject.TypeNames.Insert(0, 'JiraPS.IssueType') - return $object - } - Mock ConvertTo-JiraCreateMetaField -ModuleName JiraPS { $InputObject } diff --git a/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 b/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 index 8ccb039f..6b76ae53 100644 --- a/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 +++ b/Tests/Functions/New-JiraIssue.Unit.Tests.ps1 @@ -39,6 +39,7 @@ Describe "New-JiraIssue" -Tag 'Unit' { $jiraServer = 'https://jira.example.com' + $issueTypeTest = 1 Mock Get-JiraConfigServer { $jiraServer @@ -56,22 +57,20 @@ Describe "New-JiraIssue" -Tag 'Unit' { } Mock Get-JiraProject { + $issueObject = [PSCustomObject] @{ + ID = $issueTypeTest + Name = 'Test Issue Type' + } + $issueObject.PSObject.TypeNames.Insert(0, 'JiraPS.IssueType') $object = [PSCustomObject] @{ 'ID' = $Project 'Key' = "TEST" } + Add-Member -InputObject $object -MemberType NoteProperty -Name "IssueTypes" -Value $issueObject $object.PSObject.TypeNames.Insert(0, 'JiraPS.Project') return $object } - Mock Get-JiraIssueType { - $object = [PSCustomObject] @{ - 'ID' = $IssueType; - } - $object.PSObject.TypeNames.Insert(0, 'JiraPS.IssueType') - return $object - } - Mock Get-JiraUser { $object = [PSCustomObject] @{ 'Name' = $UserName; From fc1c0c922acc0dfe3e8dda3e2bf823f5d60ae86b Mon Sep 17 00:00:00 2001 From: Joel Nolan Date: Mon, 18 Feb 2019 08:58:24 -0800 Subject: [PATCH 16/20] ** Fix use of Get-JiraUser to support use with a session or a credential object --- JiraPS/Public/New-JiraIssue.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JiraPS/Public/New-JiraIssue.ps1 b/JiraPS/Public/New-JiraIssue.ps1 index 8bf18f57..ee2beced 100644 --- a/JiraPS/Public/New-JiraIssue.ps1 +++ b/JiraPS/Public/New-JiraIssue.ps1 @@ -97,7 +97,7 @@ function New-JiraIssue { } elseif ($ProjectObj.Style -eq "next-gen"){ Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Adding reporter as next-gen projects must have reporter set." - $requestBody["reporter"] = @{"name" = "$((Get-JiraUser -UserName ((Get-JiraSession).UserName)).Name)"} + $requestBody["reporter"] = @{"name" = "$((Get-JiraUser -Credential $Credential).Name)"} } if ($Parent) { From e5ea95f9e5ff5267926689c993863a6d3e367100 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 21 Feb 2019 21:17:54 +0100 Subject: [PATCH 17/20] Fixed the case of the get parameter to skip notifications on issue update --- JiraPS/Public/Set-JiraIssue.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JiraPS/Public/Set-JiraIssue.ps1 b/JiraPS/Public/Set-JiraIssue.ps1 index 01bce57c..035d4f00 100644 --- a/JiraPS/Public/Set-JiraIssue.ps1 +++ b/JiraPS/Public/Set-JiraIssue.ps1 @@ -181,7 +181,7 @@ function Set-JiraIssue { $SkipNotificationParams = @{} if ($SkipNotification) { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Skipping notification for watchers" - $SkipNotificationParams = @{notifyUsers = $false} + $SkipNotificationParams = @{notifyUsers = "false"} } if ( @($issueProps.update.Keys).Count -gt 0 ) { From d8de27236841f1c9a20e0d6cddb10229ea36fd6e Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 21 Feb 2019 21:40:36 +0100 Subject: [PATCH 18/20] Updated changelog for v2.10 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a53cd0e..4ba15a8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,20 @@ ## [NEXT VERSION] - YYYY-MM-DD +## [2.10] - 2019-02-21 + ### Added - Parameter for retrieving information about a specific user with `Get-JiraUser` (#328, [@michalporeba]) - this implementations will be changed with the next major update in favor of #306 +### Changed + +- Fixed logic of how to retrieve components from project (#330, [@lipkau]) +- Fix usage of `New-JiraIssue` in Jira Environment with mixed classic and "next gen" projects (#337, [@nojp]) +- Fixed `Get-JiraIssueAttachmentFile` to use `Accept` header based on Mime time of attachment (#333, [@wisemoth]) +- Fixed incorrect handling of skip notifications when updating an issue (#339, [@lipkau]) + ## [2.9] - 2018-12-12 ### Added @@ -318,7 +327,9 @@ which is in turn inspired by the [Vagrant](https://github.com/mitchellh/vagrant/ [@lipkau]: https://github.com/lipkau [@lukhase]: https://github.com/lukhase [@michalporeba]: https://github.com/michalporeba + [@nojp]: https://github.com/nojp [@padgers]: https://github.com/padgers [@ThePSAdmin]: https://github.com/ThePSAdmin [@tuxgoose]: https://github.com/tuxgoose [@WindowsAdmin92]: https://github.com/WindowsAdmin92 + [@wisemoth]: https://github.com/wisemoth From e2b841941a0ac85486ea567cc4141d259d8dc5fb Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 21 Feb 2019 21:41:09 +0100 Subject: [PATCH 19/20] Removed posts from this repo --- _posts/2017-06-24-JiraPS-v2.0.md | 28 -------- _posts/2017-06-25-JiraPS-v2.1.md | 73 -------------------- _posts/2017-08-05-JiraPS-v2.2.md | 48 -------------- _posts/2017-10-07-JiraPS-v2.3.md | 49 -------------- _posts/2017-12-05-JiraPS-v2.4.md | 50 -------------- _posts/2018-03-22-JiraPS-v2.5.md | 67 ------------------- _posts/2018-05-04-JiraPS-v2.6.md | 62 ----------------- _posts/2018-05-13-JiraPS-v2.7.md | 71 -------------------- _posts/2018-06-28-JiraPS-v2.8.md | 110 ------------------------------- 9 files changed, 558 deletions(-) delete mode 100644 _posts/2017-06-24-JiraPS-v2.0.md delete mode 100644 _posts/2017-06-25-JiraPS-v2.1.md delete mode 100644 _posts/2017-08-05-JiraPS-v2.2.md delete mode 100644 _posts/2017-10-07-JiraPS-v2.3.md delete mode 100644 _posts/2017-12-05-JiraPS-v2.4.md delete mode 100644 _posts/2018-03-22-JiraPS-v2.5.md delete mode 100644 _posts/2018-05-04-JiraPS-v2.6.md delete mode 100644 _posts/2018-05-13-JiraPS-v2.7.md delete mode 100644 _posts/2018-06-28-JiraPS-v2.8.md diff --git a/_posts/2017-06-24-JiraPS-v2.0.md b/_posts/2017-06-24-JiraPS-v2.0.md deleted file mode 100644 index ce387300..00000000 --- a/_posts/2017-06-24-JiraPS-v2.0.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.0.0 -title: JiraPS v2.0.0 -date: 2017-06-24 13:00:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.0.0.2) and to [GitHub](https://github.com/AtlassianPS/JiraPS/releases/tag/v2.0.0). - - -# Description - -This is the first release of **JiraPS** under the _AtlassianPS_ organization. -This release **contains breaking changes** – so please be aware and careful when updating the module. - -# CHANGELOG - -## Changes to the code module - -* Move module to organization _AtlassianPS_ -* Rename of the module to `JiraPS` **[breaking change]** -* Rename of module’s custom objects to `JiraPS.*` **[breaking change]** diff --git a/_posts/2017-06-25-JiraPS-v2.1.md b/_posts/2017-06-25-JiraPS-v2.1.md deleted file mode 100644 index ea4b2ee0..00000000 --- a/_posts/2017-06-25-JiraPS-v2.1.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.1.0 -title: JiraPS v2.1.0 -date: 2017-06-25 12:00:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.1.0.10) and to [GitHub](https://github.com/AtlassianPS/JiraPS/releases/tag/v2.1.0). - - -# Description - -This release brings a lot of new functionality, improvements and bug fixes that has been submitted by our contributors. Including: - -* Managing RemoteLinks -* Managing IssueLinks -* Managing Watchers -* Adding Worklogs -* and much more (listed below) - -**We highly recommend updating, as this release contains really great stuff.** - -# CHANGELOG - -## FEATURES - -* `Get-JiraIssueEditMetadata`: Returns metadata required to create an issue in JIRA (#65, [@lipkau][]) -* `Get-JiraRemoteLink`: Returns a remote link from a JIRA issue (#80, [@lipkau][]) -* `Remove-JiraRemoteLink`: Removes a remote link from a JIRA issue (#80, [@lipkau][]) -* `Get-JiraComponent`: Returns a Component from JIRA (#68, [@axxelG][]) -* `Add-JiraIssueWorklog`: Add worklog items to an issue (#83, [@jkknorr][]) -* Added support for getting and managing Issue Watchers (`Add-JiraIssueWatcher`, `Get-JiraIssueWatcher`, `Remove-JiraIssueWatcher`) (#73, [@ebekker][]) -* Added IssueLink functionality (`Add-JiraIssueLink`, `Get-JiraIssueLink`, `Get-JiraIssueLinkType`, `Remove-JiraIssueLink`) (#131, [@lipkau][]) - -## IMPROVEMENTS - -* `New-JiraIssue`: _Description_ and _Priority_ are no longer mandatory (#53, [@brianbunke][]) -* Added property `Components` to `PSJira.Project` (#68, [@axxelG][]) -* `Invoke-JiraIssueTransition`: add support for parameters _Fields_, _Comment_ and _Assignee_ (#38, [@padgers][]) -* `New-JiraIssue`: support parameter _FixVersion_ (#103, [@Dejulia489][]) -* `Set-JiraIssue`: support parameter _FixVersion_ (#103, [@Dejulia489][]) -* Respect the global `$PSDefaultParameterValues` inside the module (#110, [@lipkau][]) -* `New-JiraSession`: Display warning when login needs CAPTCHA (#111, [@lipkau][]) -* Switched to _Basic Authentication_ when generating the session (#116, [@lipkau][]) -* Added more tests for the CI (#142, [@lipkau][]) - -## BUG FIXES - -* `Invoke-JiraMethod`: Error when Invoke-WebRequest returns '204 No content' (#42, [@colhal][]) -* `Invoke-JiraIssueTransition`: Error when Invoke-WebRequest returns '204 No content' (#43, [@colhal][]) -* `Set-JiraIssueLabel`: Forced label property to be an array (#88, [@kittholland][]) -* `Invoke-JiraMethod`: Send ContentType as Parameter instead of in the Header (#121, [@lukhase][]) - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@brianbunke]: https://github.com/brianbunke - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin diff --git a/_posts/2017-08-05-JiraPS-v2.2.md b/_posts/2017-08-05-JiraPS-v2.2.md deleted file mode 100644 index 2f8714fb..00000000 --- a/_posts/2017-08-05-JiraPS-v2.2.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.2.0 -title: JiraPS v2.2.0 -date: 2017-08-05 12:00:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.2.0.141) and to [GitHub](https://github.com/AtlassianPS/JiraPS/releases/tag/v2.2.0.141). - - -# Description - -This release brings new functionality, improvements and bug fixes that has been submitted by our contributors. Including: - -* Functions to manage Versions in Jira - -Details are listed below - -# CHANGELOG - -## FEATURES - -* `New-JiraVersion`: Create a new Version in a project (#158, [@Dejulia489][]) -* `Get-JiraVersion`: Create a new Version in a project (#158, [@Dejulia489][]) -* `Set-JiraVersion`: Create a new Version in a project (#158, [@Dejulia489][]) -* `Remove-JiraVersion`: Create a new Version in a project (#158, [@Dejulia489][]) -* New custom object for Versions (#158, [@Dejulia489][]) - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@brianbunke]: https://github.com/brianbunke - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin diff --git a/_posts/2017-10-07-JiraPS-v2.3.md b/_posts/2017-10-07-JiraPS-v2.3.md deleted file mode 100644 index b46b4b96..00000000 --- a/_posts/2017-10-07-JiraPS-v2.3.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.3 -title: JiraPS v2.3 -date: 2017-10-07 13:50:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.3.160) and to [GitHub](https://github.com/AtlassianPS/JiraPS/releases/tag/v2.3.160). - - -# Description - -This release brings new functionality, improvements and bug fixes that has been submitted by our contributors. - -Details are listed below - -# CHANGELOG - -## FEATURES - -* `Get-JiraServerInformation`: Fetches the information about the server (#187, [@lipkau][]) - -## IMPROVEMENTS - -* Added `-AddComment` to `Set-JiraIssue`. Allowing the user to write a comment for the changes to the issue (#167, [@Clijsters][]) -* Changed the default visibility of comments (#172, [@lipkau][]) -* Added more properties to `JiraPS.User` objects (#152, [@lipkau][]) - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@brianbunke]: https://github.com/brianbunke - [@Clijsters]: https://github.com/Clijsters - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin diff --git a/_posts/2017-12-05-JiraPS-v2.4.md b/_posts/2017-12-05-JiraPS-v2.4.md deleted file mode 100644 index d7715dd3..00000000 --- a/_posts/2017-12-05-JiraPS-v2.4.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.4 -title: JiraPS v2.4 -date: 2017-12-05 23:51:07 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.4.0) and to [GitHub](https://github.com/AtlassianPS/JiraPS/releases/tag/v2.4.0). - - -# Description - -This release brings new functionality, improvements and bug fixes that has been submitted by our contributors. - -Details are listed below - -# CHANGELOG - -## 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][]) - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@beaudryj]: https://github.com/beaudryj - [@brianbunke]: https://github.com/brianbunke - [@Clijsters]: https://github.com/Clijsters - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin diff --git a/_posts/2018-03-22-JiraPS-v2.5.md b/_posts/2018-03-22-JiraPS-v2.5.md deleted file mode 100644 index 4ce3eafa..00000000 --- a/_posts/2018-03-22-JiraPS-v2.5.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.5 -title: JiraPS v2.5 -date: 2018-03-22 20:10:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.5.0) and to [GitHub](https://github.com/AtlassianPS/JiraPS/tree/v2.5.0). - - -# Description - -This release does not contain new features, but is an important step towards harmonizing the code across all the functions and with other AtlassianPS modules. - -The full list of bugs and under the hood improvements is listed in the [changelog](#changelog). - -One change that will make debugging a lot easier are the changes to `-debug` and `-verbose` across all of the functions. -Here you can see some how they changed: - -| |v2.4|v2.5| -|:-:|:------:|:------:| -|`-verbose`|[![Old Verbose Messages](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.4-verbose_thumbnail.png)](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.4-verbose.png)|[![New Verbose Messages](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.5-verbose_thumbnail.png)](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.5-verbose.png)| -|`-debug`|[![Old Debug Messages](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.4-debug_thumbnail.png)](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.4-debug.png)|[![New Debug Messages](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.5-debug_thumbnail.png)](/assets/img/2018-03-22-JiraPS-v2.5-JiraPS2.5-debug.png)| - -# CHANGELOG - -## IMPROVEMENTS - -* Harmonized code style (#162, [@lipkau][]) -* Harmonized verbose messages (#162, [@lipkau][]) -* Harmonized debug messages (#162, [@lipkau][]) -* Improved debug behavior (#162, [@lipkau][]) -* Update of VS code config to reflect code styling (#162, [@lipkau][]) -* Few improvements in test cases (#162, [@lipkau][]) -* Added parameter validation (#162, [@lipkau][]) -* Updated manifest (#162, [@lipkau][]) -* Minor preparations for pwsh support (#162, [@lipkau][]) -* Execute Tests against `./Release` (#162, [@lipkau][]) -* Removed unused `$ConfigFile` variable (#219, [@lipkau][]) -* `Invoke-JiraMethod` now sets the TLS to 1.2 before every call (#84, [@lipkau][]) -* Fixed _date_ and _timespan_ representation in _Body_ of `Add-JiraIssueWorklog` (#214, [@lipkau][]) -* Improved output of `Get-JiraProject` (#216, [@lipkau][]) - -Full list of issues can be found in [Milestone v2.5](https://github.com/AtlassianPS/JiraPS/milestone/8). - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@beaudryj]: https://github.com/beaudryj - [@brianbunke]: https://github.com/brianbunke - [@Clijsters]: https://github.com/Clijsters - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin diff --git a/_posts/2018-05-04-JiraPS-v2.6.md b/_posts/2018-05-04-JiraPS-v2.6.md deleted file mode 100644 index b2051d9d..00000000 --- a/_posts/2018-05-04-JiraPS-v2.6.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.6 -title: JiraPS v2.6 -date: 2018-05-04 22:30:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.6.0) and to [GitHub](https://github.com/AtlassianPS/JiraPS/tree/v2.6.0). - - -# Description - -This release brings new functionality, improvements and bug fixes that has been submitted by our contributors. - -# CHANGELOG - -## FEATURES - -* Added `-Passthru` parameter to `Invoke-JiraIssueTransition` (#239, [@lipkau][]) -* Added `Get-JiraUser` functionality to find the current user (#231, [@lipkau][]) -* Added full support for PowerShell Core (v6) and Linux/MacOS support (#230, [@lipkau][]) -* Added JiraPS documentation on the homepage (#230, [@lipkau][]) - -## IMPROVEMENTS - -* Exposed `Invoke-JiraMethod` as a public function (#233, [@lipkau][]) -* Migrated to External Help (instead of Comment-Based Help) (#230, [@lipkau][]) - -### BUG FIXES - -* Index Into Null Object (#209, [@lipkau][]) -* Fix empty header (#206, [@lipkau][]) -* Bad Body (#224, [@lipkau][]) -* Add Labels to array (#226, [@lipkau][]) -* Fix removing labels with `Set-JiraIssueLabel -Remove` (#244, [lipkau][]) -* Fix adding of multiple labels at once with `Set-JiraIssueLabel -Add` (#244, [lipkau][]) - -Full list of issues can be found in [Milestone v2.6](https://github.com/AtlassianPS/JiraPS/milestone/9). - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@beaudryj]: https://github.com/beaudryj - [@brianbunke]: https://github.com/brianbunke - [@Clijsters]: https://github.com/Clijsters - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin - \ No newline at end of file diff --git a/_posts/2018-05-13-JiraPS-v2.7.md b/_posts/2018-05-13-JiraPS-v2.7.md deleted file mode 100644 index 3a6ee675..00000000 --- a/_posts/2018-05-13-JiraPS-v2.7.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.7 -title: JiraPS v2.7 -date: 2018-05-13 20:00:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.7.0) and to [GitHub](https://github.com/AtlassianPS/JiraPS/tree/v2.7.0). - - -# Description - -This release brings new functionality, improvements and bug fixes that has been submitted by our contributors. - -During some debugging of the CI in version 2.6, some version with incorrect numbers where published to the Powershell Gallery. -Therefore this version was released earlier than anticipated to avoid those versions to adopted on a larger scale. - -Further, this release brings with it a major refactoring of the build script. -You can read all about it bellow. - -# CHANGELOG - -## IMPROVEMENTS - -* Improved build script (#252, [@lipkau][]) - * This project now uses `PSDepend` to declare and fulfill it's dependencies - * Tagging of the repository and publishing of a github is no longer part of AppVeyor's configuration. - This was generating tags and releases before the CI could be sure it passes - it was doing so with the first job that succeeded. - Not the build script makes sure only the last job of the build can perform these actions. - * Extracted detailed and long logics into functions and removed from the script - no it's a `build.psm1` module - * Removed conversion of `.md` files to html - and the dependency to _pandoc_ with it - * Clean-up -* Reduced the Pester output in CI build for PR (#257, [@lipkau][]) -* Evaluate the Headers returned by the API for better authentication handling (#256, [@lipkau][]) -* Writing and throwing of errors show better context (#199, [@lipkau][]) -* Improved validation of parameters in `Add-JiraGroupMember` (#250, [@WindowsAdmin92][]) -* Improved casting to `-Fields` by defining it's type as `[PSCustomObject]` (#255, [@lipkau][]) - -## BUG FIXES - -* Build script was not publishing to the PSGallery (#252, [@lipkau][]) -* Build script was publishing a new tag to repository even in case the build failed (#252, [@lipkau][]) -* Fixed CI icon in README (#245, [@lipkau][]) -* Fixed the adding multiple labels and the removal of those in `Set-JiraIssueLabel` (#244, [@lipkau][]) -* Allow `Get-JiraUser` to return more than 1 result (#246, [@lipkau][]) - -Full list of issues can be found in [Milestone v2.7](https://github.com/AtlassianPS/JiraPS/milestone/10). - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@beaudryj]: https://github.com/beaudryj - [@brianbunke]: https://github.com/brianbunke - [@Clijsters]: https://github.com/Clijsters - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin - [@WindowsAdmin92]: https://github.com/WindowsAdmin92 diff --git a/_posts/2018-06-28-JiraPS-v2.8.md b/_posts/2018-06-28-JiraPS-v2.8.md deleted file mode 100644 index a9d83252..00000000 --- a/_posts/2018-06-28-JiraPS-v2.8.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -layout: article -permalink: /article/Announcement/JiraPS-v2.8 -title: JiraPS v2.8 -date: 2018-06-28 12:00:00 -categories: Announcement -thumbnail: -author: lipkau -tags: - - JiraPS - - Release ---- - -We have just uploaded a new version of the **JiraPS** module to the [Gallery](https://www.powershellgallery.com/packages/JiraPS/2.8.0) and to [GitHub](https://github.com/AtlassianPS/JiraPS/tree/v2.8.0). - - -# Description - -This release brings new functionality, improvements and bug fixes that has been submitted by our contributors. - -# CHANGELOG - -## IMPROVEMENTS - -* Added support for paginated response from API server by means of `-Paging` (#291, [@lipkau[]]) - * moved default values to `JiraPS.psm1` so that they could be changed from outside of the module - _in preparation for using `Configuration`_ - * added logic for `Command parameters` > `Global defaults` > `module defaults` - * huge improvement to Unit Tests for `Invoke-JiraMethod` - * improved how HTTP responses > 399 are handled (`Resolve-ErrorWebResponse`) - * added `.EXTERNALHELP` to all functions (needed for Powershell v3) - * updated all functions which can use paging so that they use the new `-Paging` functionality - * `Get-JiraGroupMember` - * `Get-JiraIssue -Query` - * `Get-JiraIssue -Filter` - * `Get-JiraIssueComment` - * `Get-JiraVersion` - * added `-Sort` to influence the sorting of the results - * added default `PageSize` - * marked parameters which duplicate `[SupportsPaging]` parameter as **deprecated**. These are: - * `Get-JiraGroupMember -StartIndex` - * `Get-JiraGroupMember -MaxResults` - * `Get-JiraIssue -StartIndex` - * `Get-JiraIssue -MaxResults` - * added `-Headers` logic to `New-JiraSession` -* Updated `Pester` to version `4.3.1` (#289, [@lipkau[]]) -* Added full set of functions to manage Filter Permissions (#289, [@lipkau[]]) - * introduced a new Object _`[JiraPS.FilterPermission]`_ - * added property `FilterPermissions` to _`[JiraPS.Filter]`_ which is the list of _`[JiraPS.FilterPermission]`_ of this Filter - * introduced a new Object _`[JiraPS.ProjectRole]`_ - * added `Add-JiraFilterPermission` - * added `Get-JiraFilterPermission` - * added `Remove-JiraFilterPermission` -* Added `-Id` parameter to `Remove-JiraFilter` (#288, [@lipkau[]]) - * by adding `-Id` parameter (which accepts a value by pipeline), this function can now - be used in scenarios like `Get-Content "listOfFilter.txt | Remover-JiraFilter` -* Changed logic of `Get-JiraUser` to return multiple results for a search (#272, [@lipkau[]]) - * `Get-JiraUser` was hard-coded to return only one result, while the API can return multiple results - * added parameter (`-MaxResults`, `-Skip`) to influence the results of the API - * _API has a limitation of 1000 items in response_ -* Added posts for homepage to the module's repository (#268, [@lipkau[]]) - * by maintaining the posts of the homepage in the module's repository, the new version of the - module can be deployed without manual changes to the homepage (thanks to #259 mentioned bellow) -* Improved handling of _Credentials_ (#271, [@lipkau[]]) - * added an empty _`[Credential]`_ object as default value - * `-Credential "Username"` now uses the _`[String]`_ as value for the Username in the Credentials dialog - * this change is important for Powershell v3 compatibility -* Added missing interactions with _Filters_ (#266, [@lipkau[]]) - * added `-Favorite` to `Get-JiraFilter`, which lists all Filters marked as favorite by the user - * added `New-JiraFilter` - * added `Remove-JiraFilter` - * added `Set-JiraFilter` -* Added `Remove-JiraIssue` (#265, [@hmmwhatsthisdo[]]) -* Improved Build script (to deploy changes to the homepage) (#259, [@lipkau[]]) - -## BUG FIXES - -* Reverted `Add-JiraIssueAttachment` as JiraPS v2.7 broke it (#287, [@lipkau[]]) - * `JiraPS v2.7` tried to move the logic for generating the `multipart/form-data` to `Invoke-WebRequest` - * this is still desired, but as it broke the functionality of `Add-JiraIssueAttachment`, - this was rolled-back - * shall be fixed/re-implemented with [#284](https://github.com/AtlassianPS/JiraPS/issues/284) -* Fixed resolving of Remote Link (#286, [@lipkau[]]) - * function was using the wrong private function for converting the response to custom object -* Improved error handling for ErrorDetails and non-JSON/HTML responses (#277, [@hmmwhatsthisdo[]]) -* Fully support Powershell v3 (#273, [@lipkau[]]) -* Fixed parameter used in documentation but not in code (#263, [@lipkau[]]) - * added alias `-Issue` to `Get-JiraIssue -Key` as the documentation used it - * updated documentation to use the `-Key` parameter - -_Full list of issues can be found in [Milestone v2.8](https://github.com/AtlassianPS/JiraPS/milestone/11)._ - - - [@alexsuslin]: https://github.com/alexsuslin - [@axxelG]: https://github.com/axxelG - [@beaudryj]: https://github.com/beaudryj - [@brianbunke]: https://github.com/brianbunke - [@Clijsters]: https://github.com/Clijsters - [@colhal]: https://github.com/colhal - [@Dejulia489]: https://github.com/Dejulia489 - [@ebekker]: https://github.com/ebekker - [@hmmwhatsthisdo]: https://github.com/hmmwhatsthisdo - [@jkknorr]: https://github.com/jkknorr - [@kittholland]: https://github.com/kittholland - [@LiamLeane]: https://github.com/LiamLeane - [@lipkau]: https://github.com/lipkau - [@lukhase]: https://github.com/lukhase - [@padgers]: https://github.com/padgers - [@ThePSAdmin]: https://github.com/ThePSAdmin - [@WindowsAdmin92]: https://github.com/WindowsAdmin92 From e8d92b7c04e4b04e3a59984073956ab74acec702 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 21 Feb 2019 21:41:20 +0100 Subject: [PATCH 20/20] Bumped module version to v2.10 --- JiraPS/JiraPS.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JiraPS/JiraPS.psd1 b/JiraPS/JiraPS.psd1 index 75c2ed6f..5b9dc3a4 100644 --- a/JiraPS/JiraPS.psd1 +++ b/JiraPS/JiraPS.psd1 @@ -4,7 +4,7 @@ RootModule = 'JiraPS.psm1' # Version number of this module. - ModuleVersion = '2.9' + ModuleVersion = '2.10' # Supported PSEditions # CompatiblePSEditions = @()