Alerting

Why do Custom Alert Actions values of Yes or No in a selection take different values?

mkolkebeck
Path Finder

Is this a known bug?

Following along with the HipChat example code (linked below), if I change the Background Color control-group code to what is displayed in the first code snippet below, then action.hipchat.param.color takes on the values of 1 or 0 when saving the alert action form, instead of what I'd expect to be a "Yes" or "No" string value (respectively).

Excerpt of edited $SPLUNK_HOME$/etc/apps/hipchat_app/default/data/ui/alerts/hipchat.html
http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ModAlertsAdvancedExample

<div class="control-group">
    <label class="control-label" for="hipchat_color">Background Color</label>

    <div class="controls">
        <select id="hipchat_color" name="action.hipchat.param.color">
            <option value="Yes">Yes</option>
            <option value="No">No</option>
        </select>
        <span class="help-block">Change the background of the hipchat message.</span>
    </div>
</div>

This is an issue because when I go to pull up the alert action again, it does not load the correct param (the form expects a "Yes" or "No" value, but gets a 1 or 0).

As a workaround, I've had to edit the values to a 1 or 0 as such to get this to work as I expect it to:

<div class="control-group">
    <label class="control-label" for="hipchat_color">Background Color</label>

    <div class="controls">
        <select id="hipchat_color" name="action.hipchat.param.color">
            <option value="1">Yes</option>
            <option value="0">No</option>
        </select>
        <span class="help-block">Change the background of the hipchat message.</span>
    </div>
</div>
0 Karma

goelli
Communicator

Hi,

I came accross this old question via google search on alert on splunk-control-group topic. As there is not much information in docs and answers, it might be still relevant.

Did you specify action.hipchat.param.color in apps/README/alert_actions.conf.spec file as <boolean>? If so, you can change it to <string> and see, if it makes a difference?

Best regards

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...