Home Analyst Portal

Change status by SMLets

Ozgur_SahinOzgur_Sahin Customer IT Monkey ✭
Hello Cireson Community

I have a question
I want to change the Resolved status TO Closed Status for all IRs with status "resolved"
For this , I will use the SMLets commands

Import-Module SMLets
$IncidentClass = Get-SCSMClass -Name System.WorkItem.Incident$
$StatusResolved = (Get-SCSMEnumeration IncidentStatusEnum.Resolved)
$date=(get-date).adddays(-3)
$Close_sc=Get-SCSMObject -Class $IncidentClass | where{($_.status -eq $StatusResolved) -and ($_.lastmodified -lt $date) }
$Close_sc | Set-SCSMIncident -Status Closed

This script is working correctly
but ı do not know that will be there a problem with the cireson portal after executing this script ?


Best Answers

Answers

  • Ozgur_SahinOzgur_Sahin Customer IT Monkey ✭
    You might want to take a look at the autoclose app from Cireson (free community tool):

    http://cireson.com/apps/auto-close/

    But no, I don't see a problem with this. It's a common practice for many. The "grace" period for closing the Incident after it's resolved is of course a different discussion :)


    Dear Morten_Meisler
    we  have that App
    but I don't why, the IRs which were resolved with status "Canceled by Level 1" , The status hasn't changed to CLOSE automatically

    And ı have another question, I thing , maybe there will be problems with the Cireson cache after SMlets scritp.
    for clearing the cache 
    there is a command "TRUNCATE TABLE LastModified"
    can I use this command for only clearing the cache ?
    or how you to clear the cache ?

Sign In or Register to comment.