Inbound action script help for stripping only computer name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 10:16 AM
Hello I need to create an Incident when an Email from xyz is being sent to servicenow , but email might have some computer names which I need to only get those names and set it in Description of Incident ,
Below is the email which we will get and we only want computer names under Problematic BCA clients .
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 01:48 PM
@RudhraKAM You can build regex here and use match() to retrieve the computer name data.
Doc link for further details.
Thanks
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
(function() {
// 1. Specify the Sys ID of the record producer you want to update
var recordProducerSysId = 'YOUR_RECORD_PRODUCER_SYS_ID';
// 2. Specify your target timestamp (Format: YYYY-MM-DD HH:MM:SS in UTC)
var newCreatedTimestamp = '2025-07-09 08:44:00';
var grProducer = new GlideRecord('std_change_record_producer');
if (grProducer.get(recordProducerSysId)) {
// Disable automatic updating of system fields (sys_updated_by, sys_updated_on, sys_created_on, etc.)
grProducer.autoSysFields(false);
// Set the new creation timestamp
grProducer.setValue('sys_created_on', newCreatedTimestamp);
// Execute the update
var success = grProducer.update();
if (success) {
gs.print('>>> [SUCCESS] Updated sys_created_on to ' + newCreatedTimestamp + ' for Record Producer: ' + grProducer.getDisplayValue());
} else {
gs.print('>>> [ERROR] Failed to update the record producer.');
}
} else {
gs.print('>>> [ERROR] Record Producer with Sys ID ' + recordProducerSysId + ' could not be found.');
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 06:19 PM
What's the HTML structure behind the email and aside from the count of computer names that might appear is the structure consistent?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2025 12:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2025 05:37 AM - edited 10-28-2025 06:17 AM
(function executeRule(current, previous) {
// 1. Define the property name
var propertyName = 'wf.change.success.score.icon.visibility';
// 2. Get the comma-separated list of roles from the property
var requiredRoles = gs.getProperty(propertyName);
// 3. Set the default visibility to false
g_scratchpad.showButton = 'false';
// 4. Check if the property has a value (roles specified)
if (requiredRoles) {
// 5. Check if the current user has ANY of the required roles
// gs.hasRole() can take a comma-separated string of roles.
if (gs.hasRole(requiredRoles)) {
g_scratchpad.showButton = 'true';
}
}
})(current, previous);