Getting Data In
Highlighted

Values for Endpoints defined in the setup.xml file are not refreshed

I have created a 3 attributes (url1, user& snow_password) in the setup.xml for my custom alert action app.

 <input field="param.url1">
    <label>Enter your url</label>
    <type>text</type>
 </input>   
<input field="param.user">
  <label>enter user name</label>
  <type>text</type>
</input>
<input field="param.snow_credentials">
  <label>enter password</label>
  <type>password</type>
</input>

I am using these parameters in the Python script which calls a REST API method. I am retrieving the values for these parameters as below in Python script

    snow_url = settings['configuration'].get('url1')
    user = settings['configuration'].get('user')
    password = settings['configuration'].get('snow_credentials')

The issue I am facing is, when I set the parameter values for the 1st time using Setup screen the values are correctly retrieved by the script. But when I update them using the setup screen and run the script as a alert action it still retrieves the old values of the parameter and not new once.

I tried to check the values using URL
https://localhost:8089/servicesNS/nobody//alerts/alert_actions/

I can see the updated values. I also tried to reload them and try but still the script is getting old values only. Is there anything basic I am missing here?

0 Karma
Highlighted

Re: Values for Endpoints defined in the setup.xml file are not refreshed

Above mentioned XML data is located inside below tags.

0 Karma
Highlighted

Re: Values for Endpoints defined in the setup.xml file are not refreshed

SplunkTrust
SplunkTrust

When you setup the parameters via setup page, I assume they are getting added under your app's local/ta_*settings.conf file. Does this get updated when you update the params via setup again? check your default/restmap.conf for handler actions - edit and list [ you need both]. Are you using add-on builder?

0 Karma
Highlighted

Re: Values for Endpoints defined in the setup.xml file are not refreshed

I am not using add-on builder. I started creating my app by using the reference of hipchat_alerts example.

When I update the parameters, they get updated in alert_actions.conf file in apps local directory. I have just added a validation rule in restmap.conf file, nothing about the setup parameters.

I do observed that, when I create a new alert it is getting updated values of setup parameters. So I think the json paylod passed to PYTHON script is sending old values only. I may have to use Splunk SDK to read endpoint values unless there is no alternative.

0 Karma