insomniacc / PSSnow

A powershell module for interacting with the ServiceNow REST API
GNU General Public License v3.0
40 stars 9 forks source link

New-SNOWAttachment does not work for cases #38

Closed insomniacc closed 1 year ago

insomniacc commented 1 year ago

As pointed out here: https://www.reddit.com/r/PowerShell/comments/123jlls/comment/jdv4ect/?context=3

I'll have to check the CSM plugin to see how cases are handled and if it uses the same attachment table or not.

insomniacc commented 1 year ago

I've installed CSM in my developer instance but I've been unable to replicate this issue. I can get-attachments and add attachments to cases without issue using the table API objects, it does seem to use the same table/mechanism for attachments.

Example (also shows in the web UI after a refresh):

Get-SNOWObject -table "sn_customerservice_case" -Sys_ID 882f2c7247062110d3e5fa8bd36d4353 | New-SNOWAttachment -File "C:\temp\Test.txt"
Get-SNOWObject -table "sn_customerservice_case" -Sys_ID 882f2c7247062110d3e5fa8bd36d4353 | Get-SNOWAttachment
insomniacc commented 1 year ago

Maybe it has something to do with this endpoint: https://docs.servicenow.com/bundle/sandiego-application-development/page/integrate/inbound-rest/concept/attachment_csm-api.html

insomniacc commented 1 year ago

Without a valid way to replicate the issue and no response from OP I'm closing this.