@@ -139,14 +139,14 @@ function Invoke-Query($fields, $wiql, $output = $true)
139139 return $workItems
140140}
141141
142- function BuildHashKeyFromNonNullArgs ()
142+ function BuildHashKeyNoNull ()
143143{
144144 $filterNulls = $args | Where-Object { $_ }
145- # if we had any non- nulls then return it
146- if (! $filterNulls ) {
145+ # if we had any nulls then return null
146+ if (! $filterNulls -or $args .Count -ne $filterNulls .Count ) {
147147 return $null
148148 }
149- return BuildHashKey @filterNulls
149+ return BuildHashKey $args
150150}
151151
152152function BuildHashKey ()
@@ -241,7 +241,7 @@ function FindLatestPackageWorkItem($lang, $packageName, $groupId = $null, $outpu
241241
242242function FindPackageWorkItem ($lang , $packageName , $version , $groupId = $null , $outputCommand = $true , $includeClosed = $false , $ignoreReleasePlannerTests = $true , $tag = $null )
243243{
244- $key = BuildHashKeyFromNonNullArgs $lang $packageName $version $groupId
244+ $key = BuildHashKey $lang $packageName $version $groupId
245245 if ($key -and $packageWorkItems.ContainsKey ($key )) {
246246 return $packageWorkItems [$key ]
247247 }
@@ -300,7 +300,7 @@ function FindPackageWorkItem($lang, $packageName, $version, $groupId = $null, $o
300300
301301 foreach ($wi in $workItems )
302302 {
303- $localKey = BuildHashKeyFromNonNullArgs $wi.fields [" Custom.Language" ] $wi.fields [" Custom.Package" ] $wi.fields [" Custom.PackageVersionMajorMinor" ] $wi.fields [" Custom.GroupId" ]
303+ $localKey = BuildHashKey $wi.fields [" Custom.Language" ] $wi.fields [" Custom.Package" ] $wi.fields [" Custom.PackageVersionMajorMinor" ] $wi.fields [" Custom.GroupId" ]
304304 if (! $localKey ) {
305305 $packageWorkItemWithoutKeyFields [$wi.id ] = $wi
306306 Write-Host " Skipping package [$ ( $wi.id ) ]$ ( $wi.fields [' System.Title' ]) which is missing required fields language, package, or version."
0 commit comments