I need help with activity journals

josuetest3p
Kilo Contributor

the requirement is 

Make an update on 5 INC tickets, in the activity journals your name should not show that you changed those tickets or made any updates.

i know the requirement it is on lack of details,but as far i balieve, urgencies, work notes and comments that i add by the background should not be populated as my name and could be for another user or system due to lack of information y can play with that details 

here is the stuff that i“ve done:

a BR on before  for table incident, check on update without a condition 

script for BR :

(function executeRule(current, previous /*null when async*/ ) {

    if (!gs.getUser().isInternal()) {
        return;
    }

    // run under system
    gs.runAs('system', function() {
        current.short_description = 'Updated via business rule script';
        current.urgency = 2;
        current.setWorkflow(false);
        current.setUseEngines(false);
        current.update();
    });

})(current, previous);
 
 
an then a background script which triggers the BR
script:
 
var gr = new GlideRecord('incident');
gr.orderBy('sys_created_on');
gr.setLimit(5);
gr.query();
while (gr.next()) {
    gs.log("Triggering update for Incident: " + gr.number);
    gr.short_description = 'Update via script trigger'; // Trigger the business rule
    gr.work_notes = 'test for verification';
    gr.update();
 
please i need help  
 

 

0 REPLIES 0