From 274cba7878afe298cd8814a0ab79906d945aa92c Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 6 Dec 2018 00:14:18 +0100 Subject: [PATCH] Added group membership when querying the current user --- JiraPS/Public/Get-JiraUser.ps1 | 2 +- Tests/Functions/Get-JiraUser.Unit.Tests.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/JiraPS/Public/Get-JiraUser.ps1 b/JiraPS/Public/Get-JiraUser.ps1 index 807d7587..640517ce 100644 --- a/JiraPS/Public/Get-JiraUser.ps1 +++ b/JiraPS/Public/Get-JiraUser.ps1 @@ -72,7 +72,7 @@ function Get-JiraUser { Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" $result = Invoke-JiraMethod @parameter - Write-Output (ConvertTo-JiraUser -InputObject $result) + Get-JiraUser -UserName $result.Name } "ByInputObject" { $UserName = $InputObject.Name diff --git a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 index 0c69089d..cd09868c 100644 --- a/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 +++ b/Tests/Functions/Get-JiraUser.Unit.Tests.ps1 @@ -130,6 +130,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/*/myself"} + 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 user" {