Encrypting attachment while inserting or updating a record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 06:11 AM
Hi All,
I have configured encryption context and running the script https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/script/server-scripting/concept/...
as per the doc. But this script works only when running from scripts background.
Not working in Scheduled Job (even i put as run as encryption context role) , Business rule, Script etc..
Could anyone help on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2020 07:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2020 07:39 AM
The script on that business rule.
Besides all the BR that came with the encryption support app, this looks like it was the only custom BR that I made.
var contextGR = new GlideRecord('sys_encryption_context');
contextGR.addQuery('name', 'Wire Fraud Encryption');
contextGR.query();
if (!contextGR.next()) {
gs.log("[ERROR] No encryption context found");
}
var encryptionID = contextGR.getUniqueValue();
gs.info("i am BR encryptionID-->"+encryptionID);
if (encryptionID != "") {
var sysAttachment = new GlideSysAttachment();
sysAttachment.changeEncryptionContext(current.table_name, current.table_sys_id, current.sys_id,encryptionID );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2020 07:45 AM
Thanks for all the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 12:31 AM
Hello Jeff,
I've looked through your BR and implemented on my personal instance. I tried creating an inbound email with attachments. However, the attachments were still not encrypted even BR was set on "after". The script worked when running from background.
Can you suggest anything?
Thanks.