Change user input Via Powershell
We have noticed while the user selects time in CST (when a change is supposed to start) SCSM stores it as GMT. My thought is to run a PSA to change the users input to GMT, then it should display right when the reviewers look at it.
Is there a way that I can parse and manipulate certain user imputs?
Best Answer
-
Adam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
In the following example, I'm retrieving the User Input field from a Service Request and casting the variable as XML. The "Answer" property contains my datetime stored as string. When this is casted to a [datetime] it renders in the local time zone.
Alternatively, you could read the property where you've mapped a DateTime directly. In this case, rather than casting variables, you can use the .NET Time Methods to parse accordingly.
What's true in both cases though is that I am not changing the User Input stored on the SR. Just rendering it out for my local time zone.
0
Answers
In the following example, I'm retrieving the User Input field from a Service Request and casting the variable as XML. The "Answer" property contains my datetime stored as string. When this is casted to a [datetime] it renders in the local time zone.
Alternatively, you could read the property where you've mapped a DateTime directly. In this case, rather than casting variables, you can use the .NET Time Methods to parse accordingly.
What's true in both cases though is that I am not changing the User Input stored on the SR. Just rendering it out for my local time zone.
@Adam_Dzyacky Thank you so much for this information. I was able to do what I needed.