Look For Certification results of individual Cis before closing task.

pardhiv
Tera Contributor

I Need to check in a business rule, if there are Cis certified with Empty attributes on Certification task.

 

Where is this information for each CI and its certification status stored at? 

2 REPLIES 2

priyatam_pvp
Tera Guru

Yes, you can check and also abort the update. 

Bussiness rule Conditions :

When: Before

Update: (Checked)

Filter Condition: State changes to Closed

Script :


(function executeRule(current, previous /*null when async*/) {
var emptyFields = [];

// List of fields you want to check for empty values
var fieldsToCheck = ['short_description', 'assigned_to', 'due_date', 'u_custom_field'];

fieldsToCheck.forEach(function(field) {
if (!current.getValue(field)) { // Check if the field is empty
emptyFields.push(field);
}
});

// If any required fields are empty, prevent closure and show a message
if (emptyFields.length > 0) {
gs.addErrorMessage('The following fields must be filled before closing: ' + emptyFields.join(', '));
current.setAbortAction(true); // Prevents the record from being updated
}
})(current, previous);


Please mark it helpful
Regards
Priyatam

This information is not stored in any of the fields on the certification table, It is shown when certifying on CMDB Work space.  I'm trying to figure out where that information is stored, so that I can create a Business rule