Home General Discussion

Enumeration Update with SMlets

Thomas_HathawayThomas_Hathaway Customer IT Monkey ✭
Hello,
I wrote a simple script that updates the Classification property for Incidents that are submitted via an ARO form from the portal. The support group wants to be able to report on the types of requests later that are submitted so each 'Request' has its own respective classification. Using set-smobject I update classification and the portal, console and DB update without issue. However, when I use SMLets to bring up the properties again for the same IR the value is still blank. Did I miss something, I haven't ran into this before. I recognize that if the DB is showing correct values then the reports will be accurate but I'm still curious why the PS command wouldn't bring up the updated information. Please forgive the sloppy code, it's still in test. 


  

Answers

  • Jeff_LangJeff_Lang Customer Advanced IT Monkey ✭✭✭
    without seeing exactly how you are updating the incident, which is not shown above, it is a bit hard to say.

    if not directly updating $object with the classification then something like Update-SCSMClassInstance to update the DB then it may need the object to be retrieved from the database again to get the updated information
  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    If you do a one-liner query for that same IR again (get-scsmobject -class (get-scsmclass system.workitem.incident$) -filter "id -eq IR987676") | select classification) does it still not report correctly?  My thought is maybe even though you're altering the incident, maybe requesting that variable is still just reporting the properties as they were when you first stored the IR object in the variable.
Sign In or Register to comment.