Retrieving file attachment from an Incident via PowerShell

jansi rani krishnan 601 Reputation points
2021-07-07T08:35:26.047+00:00

Hi Team,

I am working on an integration project, which has a requirement to send file attached to an incident from ITSSP to ServiceNow.

Is there a way to retrieve the File(s) associated with the Incident via PowerShell ?

Regards,
Jansi

System Center Service Manager
Windows for business | Windows Server | User experience | PowerShell
{count} votes

Accepted answer
  1. Andreas Baumgarten 123.7K Reputation points MVP Volunteer Moderator
    2021-07-07T10:20:27.027+00:00

    Hi @jansi rani krishnan ,

    there is a solution provided by Patrik Sundqvist for this:

    http://blogs.litware.se/?p=1369

    ----------

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

    Regards
    Andreas Baumgarten


1 additional answer

Sort by: Most helpful
  1. Andreas Baumgarten 123.7K Reputation points MVP Volunteer Moderator
    2021-07-22T18:10:52.613+00:00

    Hi @jansi rani krishnan ,

    you can use these two values as it is in the script. Each value is the ID of a relationship

    $WIhasAttachMent = "aa8c26dc-3a12-5f88-d9c7-753e5a8a55b4" ``= RealtionshipClass = WorkItem has Attachment $CIhasAttachMent = "095ebf2a-ee83-b956-7176-ab09eded6784" = RealtionshipClass =ConfigItem has Attachment`

    Don't worry about getting the right relationship class with Get-SCSMRelationshipClass. The Ids should be the same in every SCSM environment and SCSM version.

    ----------

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

    Regards
    Andreas Baumgarten


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.