Hello,
I have been trying to write a script using PowerShell and SMlets to get incidents in the system that are using a specific CI value and have status set to "closed". I can get the incidents that are using "Temporary CI" as the affected CI but I can't seem to figure out how to filter out by only "Closed" status incidents. Here is my script:
# Script to get tickets created with 'Temporary CI' used # Un-comment the #.Count to simply count the number of tickets with this relationship $WIAffectsCIClass = Get-SCSMRelationshipClass System.WorkItemAboutConfigItem$ $TempCIClass = Get-scsmClass COMPANY.CI.Class $TempCI = Get-scsmObject -class $TempCIClass -Filter "DisplayName -like %Temporary CI%" (Get-scsmRelationshipObject -ByTarget $TempCI | ? {$_.RelationshipID -eq $WIAffectsCIClass.ID} )#.count
What am I missing to filter out only the ones with "status=closed"?