Script check ServiceRequest for Assigned User
Best Answer
-
Adam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭So the good news is that if you're making it a workflow (i.e. a workflow inside of a management pack through the SCSM Authoring tool) you can actually target the Service Request class, then map the ID property of an SR to said input. Here's a screenshot of a workflow I've built around the Incident class:
I have PowerShell script that has a empty variable assigned within it (so per my above PS script example, instead of hard defining a SR1234 you'd just make it another variable), within the Script Properties tab here the Authoring Tool allows me to map the ID property of an Incident into that empty variable within my script. The workflow runs every hour, looks for Incidents matching some criteria, and then feeds the ID property (i.e. IRxxxx) into the script.
The bigger decision is does this workflow of yours run on a condition (i.e. something has changed on an SR) or does it run on a schedule (i.e. once an hour). The point is, this is the condition that enables a "looping" of sorts. The script itself doesn't feature a loop, it would just run once foreach SR that meets X criteria.5
Answers
I have PowerShell script that has a empty variable assigned within it (so per my above PS script example, instead of hard defining a SR1234 you'd just make it another variable), within the Script Properties tab here the Authoring Tool allows me to map the ID property of an Incident into that empty variable within my script. The workflow runs every hour, looks for Incidents matching some criteria, and then feeds the ID property (i.e. IRxxxx) into the script.
The bigger decision is does this workflow of yours run on a condition (i.e. something has changed on an SR) or does it run on a schedule (i.e. once an hour). The point is, this is the condition that enables a "looping" of sorts. The script itself doesn't feature a loop, it would just run once foreach SR that meets X criteria.