Alarm scripting

In scripting how can I lookup the roster assigned to a notification pipeline?

If I understand what you are asking try system.alarm.getRosters()

# This script will get all the rosters and list the users in them.
rosters = system.alarm.getRosters()
for key, values in rosters.iteritems():
    # key is the roster name, values is a dict of usernames
    print 'Roster', key, 'contains these users:'
    for value in values:
        print '  ', value

https://docs.inductiveautomation.com/display/DOC80/system.alarm.getRosters

That doesn’t tell me which notification pipeline(s) they’re assigned to.

What I want to do is include in my alarm email the recipient list. I can do this, but it requires inputting the roster. This makes it easier to screw up copy/pasting this script into the message expression between alarms and would break if the rosters are changed.

I do wish these alarm emails were not sent as individual emails - I understand why they are, but I have no need of the feature driving that.

1 Like

As of some 8.0.X release, you can change the email type to CC/BCC, opt out of the acknowledge link, and use a calculated roster to assemble a single virtual user that gets all the email addresses - it doesn’t solve the problem of needing to ‘know’ the source roster name in your calculated roster, but it’s still pretty close to the functionality you want. Adding a ‘group email’ setting directly to the notification block deliberately wasn’t added because notifications are meant to be able to be acknowledged, so they have to be able to be tied to a single user.