ChaitanyaKaranam / servicenow-rest-api

Node.js Wrapper library for ServiceNow REST API.
https://www.npmjs.com/package/servicenow-rest-api
MIT License
18 stars 21 forks source link

How to get the sysid of a file of download attachment ? #14

Closed rajbir123 closed 3 years ago

rajbir123 commented 3 years ago

In the network you will find two different sysid one for file attachment and the other sysid for table but how to get the sysid of a file of attachment via methods?

ChaitanyaKaranam commented 3 years ago

I added a quick fix for the package. You can use a new function ServiceNow.getAllAttachmentsMetaData

Here's documentation on how you can use this -  https://github.com/ChaitanyaKaranam/servicenow-rest-api#11-servicenowgetallattachmentsmetadata

You can get table_sys_id from ServiceNow.getSysId

Once you have table_sys_id, you can use the above function to get metadata of all the attachments. This metadata has info on sys_id