IBM QRadar SOAR

IBM QRadar

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Using addRow in Function Scripts

    Posted Tue February 19, 2019 07:47 PM
    Hello,

    I have designed a data table, and am now trying to get my function to add rows within it.  No luck as of yet.

    Is it as simple as this:

    newRow = incident.addRow("new_row")

    newRow["a"] = results.a
    newRow["b"] = results.b
    newRow["c"] = results.c

    ?

    This is what i got from the few examples I could find on the subject.

    I see there's an updated function for basing new rows on existing ones with only minor changes.  But documentation on this seems scarce, which leads me to believe that it should be either drop-dead simple, or else more documentation and examples are needed.

    FYI, the above is not working for me, but it could of course be due to something else in my code of which I am not aware at the moment.

    Just wanting to confirm that I have at least this right so far, and also hopefully get listing/confirmation on error conditions which would prevent addition of the row, such as omitting a field, misspelling, etc.

    No other functions to be called here to ensure the addition of the row?

    Any feedback appreciated. 

    Thanks,

    -Tony

    ------------------------------
    Anthony Bufort
    Integrations Engineer
    DomainTools
    Renton WA
    14252214447
    ------------------------------


  • 2.  RE: Using addRow in Function Scripts
    Best Answer

    Posted Wed February 20, 2019 12:18 PM
    That should work provided you have created the datatable called "new_rows", with columns api_names of a,b,c  

    As a sidenote trick, I often find it easy to use the "scripts" tester when I run into problems like this, make sure you have a test incident with the table on it, then create a new script from customization settings. 

    Add your code and just "hardcode" your variables for results.a (change to "someVarForA" etc) then you can do a test run against the incident and it will show you the debug errors.  

     


    ------------------------------
    CRAIG ROBERTS
    ------------------------------



  • 3.  RE: Using addRow in Function Scripts

    Posted Wed February 20, 2019 03:35 PM
    Hi Craig,

    Thank you so much for your suggestion!  Debugged my table code and worked like a charm.  I did not see any errors in the logs pertaining to what actually was wrong, but using your suggestion, I was then able to see errors and correct my code such that the row actually got created.  

    -Tony

    --
    Anthony (Tony) Bufort
    Product Integrations Engineer
    DomainTools, LLC

    T: (425) 221-4447
    E: tbufort@domaintools.com
    www.domaintools.com