forked from lazywinadmin/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d5a6bf
commit d1c59c0
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
SCSM-Get-SCSMWorkItemChildItem/Get-SCSMWorkItemChildItem.ps1
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,31 @@ | ||
Function Get-SCSMWorkItemChildItem | ||
{ | ||
param ( | ||
[Parameter(Mandatory = $True)] | ||
$inputPWI_guid | ||
) | ||
### Variables to Return | ||
$childWIs_obj = @() | ||
|
||
### MAIN | ||
$inputPWI_obj = get-scsmobject -id $inputPWI_guid | ||
$containsActivity_relclass_id = '2da498be-0485-b2b2-d520-6ebd1698e61b' | ||
$childWIs_relobj_filter = "RelationshipId -eq '$containsActivity_relclass_id'" | ||
$childWIs_relobj = Get-SCSMRelationshipObject -BySource $inputPWI_obj | where{ $_.RelationshipId -eq $containsActivity_relclass_id } | ||
ForEach ($childWI_relobj in $childWIs_relobj) | ||
{ | ||
if ($childWI_relobj.IsDeleted -ne 'false') | ||
{ | ||
|
||
$childWI_id = $childWI_relobj.TargetObject.id.guid | ||
$childWI_obj = get-scsmobject -id $childWI_id | ||
#filter for DynamicReviewerActivity | ||
If ($childWI_obj.ClassName -eq 'System.WorkItem.Activity.ReviewActivity' -AND $childWI_obj.Title -match 'DynamicReviewerActivity') | ||
{ | ||
$childWIs_obj += $childWI_obj | ||
} | ||
} | ||
} | ||
### RETURN DATA | ||
$childWIs_obj | ||
} |
10 changes: 10 additions & 0 deletions
10
SCSM-Get-SCSMWorkItemChildItem/Get-SCSMWorkItemChildItemRA.ps1
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,10 @@ | ||
# Get the review activity | ||
$childWI_ReviewerActivityHasReviewers_Class_id = '6e05d202-38a4-812e-34b8-b11642001a80' | ||
$childWI_ReviewerActivityHasReviewers_Class_obj = Get-SCSMRelationshipClass -id $childWI_ReviewerActivityHasReviewers_Class_id | ||
|
||
|
||
# Get the reviewer | ||
$childWI_ReviewerisUser_Class_id = '90da7d7c-948b-e16e-f39a-f6e3d1ffc921' | ||
$childWI_ReviewerisUser_Class_obj = Get-SCSMRelationshipClass -id $childWI_ReviewerisUser_Class_id | ||
|
||
$childWI_reviewers = Get-SCSMRelatedObject -SMObject $childWI_obj -Relationship $childWI_ReviewerActivityHasReviewers_Class_obj |