question

jansiranikrishnan-1796 avatar image
0 Votes"
jansiranikrishnan-1796 asked jansiranikrishnan-1796 commented

Retrieving file attachment from an Incident via PowerShell

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

windows-server-powershellmsc-service-manager
· 1
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.

Hi @jansiranikrishnan-1796 ,

are there any additional questions? Does the answer help to solve the issue?
If you found the answer helpful, it would be great if you please mark it "Accept as answer". This will help others to find answers in Q&A


Regards
Andreas Baumgarten

0 Votes 0 ·
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered jansiranikrishnan-1796 commented

Hi @jansiranikrishnan-1796 ,

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

· 2
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.

Hi @jansiranikrishnan-1796 ,

are there any additional questions? Does the answer help to solve the issue?
If you found the answer helpful, it would be great if you please mark it "Accept as answer". This will help others to find answers in Q&A


Kind regards
Andreas Baumgarten

0 Votes 0 ·

Hi Andreas,

Sorry for the delayed response. I had got some other high priority work.
In the attached link, I see some below hard code values. How to get these values?

$WIhasAttachMent = "aa8c26dc-3a12-5f88-d9c7-753e5a8a55b4"
$CIhasAttachMent = "095ebf2a-ee83-b956-7176-ab09eded6784"

Please help me out.

Regards,
Jansi

0 Votes 0 ·
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered jansiranikrishnan-1796 commented

Hi @jansiranikrishnan-1796 ,

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

· 1
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.

Hi Andreas,

You are amazing. Thank you for sharing the exact required information. It is perfectly working.

Regards,
Jansi

0 Votes 0 ·