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
Expand all | Collapse all

Python3 Script Error when Appending to Multiple Multi-Select Fields

  • 1.  Python3 Script Error when Appending to Multiple Multi-Select Fields

    Posted Mon December 21, 2020 02:10 PM

    All,

    When I try to append to multiple multi-select fields within the same Python 3 script, I get an error.

    Here's an example of the script and the error:

    It's strange that it's trying to add the value in line 3 to the field I used in line 1.

    If I change the version to Python 2 it works fine. Also if I change the syntax to not use .append() and instead use similar to what I found here. After some more digging I'm guessing it has something to do with the multi-select field in python 3 being '<class 'python3_runtime.context.resilient_context.ResilientList>'. 

    Is the link above and example of the preferred way to append to a multi-select field? 

    I know there is the Python 2 vs Python 3 scripting guide, but I was wondering if there is a resource that documents changes such as this as well. 

    Thanks,

    Liam.



    ------------------------------
    Liam Mahoney
    ------------------------------


  • 2.  RE: Python3 Script Error when Appending to Multiple Multi-Select Fields

    Posted Wed December 30, 2020 07:13 AM

    Hi Liam,

    There does seem to be a problem with using append on two different fields in the same script. The syntax used in the link you provided is also a valid alternative that you can use for now until this is fixed.

    For Python 3 scripting we tried to match existing Python 2 functionality as much as possible, what you see here is unintended which is why you won't find it in the documentation. Any known and expected differences should be documented here Python 2 and Python 3 differences. I will sit down with the team in the new year and make sure that section of the docs is up to date with all of the known differences. 

    Thanks again,



    ------------------------------
    Sean Mc Cann
    ------------------------------