This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Python API Change E-mail in an Action

I built this script to swap out an e-mail address in a couple of actions.. It looks like it runs successfully and Solarwinds SWQL Studio confirms that it changed. However, if I go to the action itself and look at it, it did not change. Is there something I am doing wrong here? (fairly new to scripting)

Thanks!!

def update_core_link_tracking(email):
    import requests 
    from orionsdk import SwisClient 
    npm_server = '1.2.3.4' 
    username = 'xxxxxx' 
    password = 'xxxxxx' 
    verify = False 
    if not verify: 
        from requests.packages.urllib3.exceptions import InsecureRequestWarning 
        requests.packages.urllib3.disable_warnings(InsecureRequestWarning) 
    swis = SwisClient(npm_server, username, password) 
    #
    # Get the 2 actions that need to be updated
    results = swis.query("""SELECT ActionID, ActionTypeID, Title, Description, Enabled, Uri
    FROM Orion.Actions
    WHERE Title Like 'Network_CoreLinkDown%'
    '""") 
    #
    #
    # Now loop through results and change the Description to the new e-mail info
    for each in results['results']:
        if 'Trigger' in each['Title']:
            props = {'Description': f'To: {email} <br/>From: noreply@abc.org<br/>Subject: Core Link on ${{N=Alerting;M=AlertName}} went DOWN at ${{N=Alerting;M=AlertTriggerTime;F=DateTime}}'}
            swis.update(each['Uri'], **props)        
        elif 'Reset' in each['Title']:
            props = {'Description': f'To: {email} <br/>From: noreply@abc.org<br/>Subject: Core Link on ${{N=Alerting;M=AlertName}} is back UP!'}
            swis.update(each['Uri'], **props)
update_core_link_tracking('newemail@email.com')  

Appears to be changed in SWQL Studio:

But opening the action, I see the old e-mail (blurred out here)

And when the alert is triggered which calls the action, it goes to the old e-mail address.