- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 09:15 PM - edited 11-24-2023 09:18 PM
I have this reference field in my table:
And this my code in BR:
current.vulnerability.v3_vector_string = extractedVectorWords;
When I check gs.addInfoMessage("HELLO: " + current.vulnerability.v3_vector_string);, I can see the string value. But it is not visible in the field. What is the problem?
BR is after BR with current.update();
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 11:45 PM
@vidhya_mouli Update the script as follows.
(function executeRule(current, previous /*null when async*/ ) {
var si = current.u_parent_si.getRefRecord();
var inputString = si.description;
// Get the input string parameter
var wordExtractor = new WordExtractor();
var extractedInformation = wordExtractor.extractInformation(inputString);
// Access the extracted information
var extractedVectorWords = extractedInformation.extractedVectorWords;
var extractedAssetWords = extractedInformation.extractedAssetWords;
var extractedSeverityValue = extractedInformation.extractedSeverityValue;
// gs.addInfoMessage("extractedVectorWords: " + extractedVectorWords);
// gs.addInfoMessage("extractedAssetWords: " + extractedAssetWords);
// gs.addInfoMessage("extractedSeverityValue: " + extractedSeverityValue);
//Update for Domain
if (extractedAssetWords != "No match found") {
current.dns = "/ " + extractedAssetWords;
}
//Update for Vector
if (extractedAssetWords != "No match found") {
var vulEntryGR = new GlideRecord('sn_vul_entry');
vulEntryGR.addQuery('v3_vector_string', 'LIKE', '%' + extractedVectorWords + '%');
vulEntryGR.query();
// Check if any records match the condition
if (vulEntryGR.next()) {
current.vulnerability= vulEntryGR.getValue('sys_id'); //set vulnerability
//gs.addInfoMessage('extractedVectorWords is present in v3_vector_string: ' + extractedVectorWords);
}
}
gs.addInfoMessage("CURRENT VECTOR VALUE: " + current.vulnerability.v3_vector_string);
if (extractedSeverityValue != 0) {
current.vulnerability.normalized_severity = extractedSeverityValue;
}
gs.addInfoMessage("CURRENT SEVERITY VALUE: " + current.vulnerability.normalized_severity);
//current.update();
})(current, previous);
If this is an Before BR the above script will work as it is, if this is an after BR you will have to use
current.setWorkflow(false);
current.update();
Additionally at the end of the script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 11:45 PM
@vidhya_mouli Update the script as follows.
(function executeRule(current, previous /*null when async*/ ) {
var si = current.u_parent_si.getRefRecord();
var inputString = si.description;
// Get the input string parameter
var wordExtractor = new WordExtractor();
var extractedInformation = wordExtractor.extractInformation(inputString);
// Access the extracted information
var extractedVectorWords = extractedInformation.extractedVectorWords;
var extractedAssetWords = extractedInformation.extractedAssetWords;
var extractedSeverityValue = extractedInformation.extractedSeverityValue;
// gs.addInfoMessage("extractedVectorWords: " + extractedVectorWords);
// gs.addInfoMessage("extractedAssetWords: " + extractedAssetWords);
// gs.addInfoMessage("extractedSeverityValue: " + extractedSeverityValue);
//Update for Domain
if (extractedAssetWords != "No match found") {
current.dns = "/ " + extractedAssetWords;
}
//Update for Vector
if (extractedAssetWords != "No match found") {
var vulEntryGR = new GlideRecord('sn_vul_entry');
vulEntryGR.addQuery('v3_vector_string', 'LIKE', '%' + extractedVectorWords + '%');
vulEntryGR.query();
// Check if any records match the condition
if (vulEntryGR.next()) {
current.vulnerability= vulEntryGR.getValue('sys_id'); //set vulnerability
//gs.addInfoMessage('extractedVectorWords is present in v3_vector_string: ' + extractedVectorWords);
}
}
gs.addInfoMessage("CURRENT VECTOR VALUE: " + current.vulnerability.v3_vector_string);
if (extractedSeverityValue != 0) {
current.vulnerability.normalized_severity = extractedSeverityValue;
}
gs.addInfoMessage("CURRENT SEVERITY VALUE: " + current.vulnerability.normalized_severity);
//current.update();
})(current, previous);
If this is an Before BR the above script will work as it is, if this is an after BR you will have to use
current.setWorkflow(false);
current.update();
Additionally at the end of the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2023 04:47 AM - edited 11-25-2023 04:51 AM
Thank you. This works, but the issue is it also updates other fields (I have few more references from the same reference table). I don't want other fields to update.