SCAN EDIT

From TDiWiki

Jump to: navigation, search

This script is designed to modify a specific field for every Event in a Scan. Currently the script will edit the User Defined Field 1, but can be modified to edit many other fields within the Event definition.

[edit] Script Properties

Name: SCAN_EVENT_EDIT
Description: This script will edit consoles contained in a group.
Profile: CONSOLE_MANAGER
Timeout: 30 (seconds)

[edit] Run Type

Run on Scans

[edit] Script Text

// * Copyright 1999-2011 TDi Technologies, Inc. All rights reserved. *
// * The information in this software is subject to change without   *
// * notice and should not be construed as a commitment by TDi.      *
// * Created: 3/31/2011                                              *

if (action.type != "Scan") {
  log("CONWRKS", "This is not a scan!");    // this script is intended to be run only on scans
} else {
  var scanName;
  var myScan;
  var scanEvents;
 
  scanName = action[action.type];     // get the name of the scan the script was run on
  myScan = Scan.get(scanName);
  log("CONWRKS", scanName);

  // get the events that are a part of the scan
  scanEvents = myScan.getEvents();
  for (event in scanEvents)
  {
    log("CONWRKS", scanEvents[event].name);
    scanEvents[event].udf1 = "this is user defined field 1. It is awesome!";     // set the field User Defined Field 1
    scanEvents[event].save();
  }
}

back to CWScript_-_New_for_ConsoleWorks_4.5

Personal tools