Site feedback

Konstantin-3636 avatar image
0 Votes"
Konstantin-3636 suggested AndreasBaumgarten commented

Need help coding powershell in relation to SCSM

Good afternoon.
I need help coding powershell in relation to SCSM. Please help me:)
"Get" is applied to the parameter, reads, but "Set" is not applied to the parameter, does not write the text.
Although other parameters can be changed for the incident, for example, "Status".
Tell me how to make it work.

124525-%D0%B1%D0%B5%D0%B7%D1%8B%D0%BC%D1%8F%D0%BD%D0%BD%D1%8B%D0%B8.jpg


msc-service-manager-administrationwindows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten commented

Hi @Konstantin-3636 ,

In SCSM the "Assigned To User" is a relationship and not a property/parameter of the Work Item class.

To assign a user to an Incident you need to create a new relationship object.
Please take a look here how to get this done: https://github.com/abaumgarten42/SCSM_Useful_PSscripts/blob/main/Set-PrimaryAndAssignedUser.ps1


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Konstantin-3636 avatar image
0 Votes"
Konstantin-3636 commented Konstantin-3636 edited

Hi, @AndreasBaumgarten !
How do I add a user not in the incident (- IR), but in the request (-SR)?
When you assign it to the ID, it writes the request was not found.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten commented

Hi @Konstantin-3636 ,

to get a SCSM Service Request you need to modify the "class" in the script. Instead of Get-SCSMClass -name System.WorkItem.Incident$ it is Get-SCSMClass -name System.WorkItem.ServiceRequest$

I would recommend to post your questions in Microsoft Q&A using "Ask a question" and not in the "Site feedback for Q&A" ;-)


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Your Opinion Counts

Share your feedback, or help out by voting for other people's feedback.