How do you tell if an Attachment is encrypted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 09:22 AM
Hi,
Does anyone know how to query the sys_attachment table to tell if an attachment is encrypted or not? Is there another table that needs to be looked at?
Thanks,
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 03:37 AM
@Victor43 Please refer the link below,
Other optional links :
Please mark this as helpful and accept it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
This is unhelpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 03:49 AM
Hi @Victor43,
To check if an attachment is encrypted in ServiceNow via script, you can use GlideSysAttachment API. Here's a sample script:
```javascript
var attachmentSysId = 'attachment_sys_id_here'; // Replace 'attachment_sys_id_here' with the sys_id of the attachment you want to check
var attachmentGR = new GlideRecord('sys_attachment');
if (attachmentGR.get(attachmentSysId)) {
if (attachmentGR.isEncrypted()) {
gs.info('Attachment is encrypted.');
} else {
gs.info('Attachment is not encrypted.');
}
} else {
gs.info('Attachment not found.');
}
```
This script checks if the attachment with the specified sys_id is encrypted or not. If it is encrypted, it logs a message saying so; otherwise, it logs that the attachment is not encrypted.
Please accept my solution if it resolves your issue and thumps 👍 up
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
NO, THIS IS NOT HELPFUL!
YOU JUST ASKED A GPT, WHICH HALLUCINATED, AND YOU NEVER CHECKED YOUR ANSWER.
IT'S SAD THAT THERE'S NO "UNHELPFUL" BUTTON HERE.