@@ -65,6 +65,14 @@ function CheckDevOpsAccess()
6565 }
6666}
6767
68+ function GetGroupId ($pkg )
69+ {
70+ if ($pkg.PSObject.Properties.Name -contains " GroupId" ) {
71+ return $pkg.GroupId
72+ }
73+ return $null
74+ }
75+
6876function Invoke-AzBoardsCmd ($subCmd , $parameters , $output = $true )
6977{
7078 $azCmdStr = " az boards ${subCmd} $ ( $parameters -join ' ' ) "
@@ -466,10 +474,11 @@ function UpdatePackageWorkItemReleaseState($id, $state, $releaseType, $outputCom
466474
467475function FindOrCreateClonePackageWorkItem ($lang , $pkg , $verMajorMinor , $allowPrompt = $false , $outputCommand = $false , $relatedId = $null , $tag = $null , $ignoreReleasePlannerTests = $true )
468476{
469- $workItem = FindPackageWorkItem - lang $lang - packageName $pkg.Package - version $verMajorMinor - includeClosed $true - outputCommand $outputCommand - tag $tag - ignoreReleasePlannerTests $ignoreReleasePlannerTests - groupId $pkg.GroupId
477+ $groupId = GetGroupId $pkg
478+ $workItem = FindPackageWorkItem - lang $lang - packageName $pkg.Package - version $verMajorMinor - includeClosed $true - outputCommand $outputCommand - tag $tag - ignoreReleasePlannerTests $ignoreReleasePlannerTests - groupId $groupId
470479
471480 if (! $workItem ) {
472- $latestVersionItem = FindLatestPackageWorkItem - lang $lang - packageName $pkg.Package - outputCommand $outputCommand - tag $tag - ignoreReleasePlannerTests $ignoreReleasePlannerTests - groupId $pkg .GroupId
481+ $latestVersionItem = FindLatestPackageWorkItem - lang $lang - packageName $pkg.Package - outputCommand $outputCommand - tag $tag - ignoreReleasePlannerTests $ignoreReleasePlannerTests - groupId $groupId
473482 $assignedTo = " me"
474483 $extraFields = @ ()
475484 if ($latestVersionItem ) {
@@ -519,11 +528,7 @@ function CreateOrUpdatePackageWorkItem($lang, $pkg, $verMajorMinor, $existingIte
519528 }
520529
521530 # PackageProp object uses Group, while other places use GroupId, such as in work item fields and package csv files.
522- $pkgGroupId = if ($pkg.PSObject.Properties.Name -contains " GroupId" ) {
523- $pkg.GroupId
524- } else {
525- $null
526- }
531+ $pkgGroupId = GetGroupId $pkg
527532 $pkgName = $pkg.Package
528533 $pkgDisplayName = $pkg.DisplayName
529534 $pkgType = $pkg.Type
@@ -1043,7 +1048,7 @@ function UpdatePackageVersions($pkgWorkItem, $plannedVersions, $shippedVersions)
10431048function UpdateValidationStatus ($pkgvalidationDetails , $BuildDefinition , $PipelineUrl )
10441049{
10451050 $pkgName = $pkgValidationDetails.Name
1046- $groupId = $pkgValidationDetails.GroupId
1051+ $groupId = GetGroupId $pkgValidationDetails
10471052 $versionString = $pkgValidationDetails.Version
10481053
10491054 $parsedNewVersion = [AzureEngSemanticVersion ]::new($versionString )
0 commit comments