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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...