On Call Roster Calculated script

Hi, I'm working on dynamic on call roster, I try to take the alarm display path to my 'Calculated' script and try to extract the my 'area number' from the display path message. I tried some scripts but that's not help to get my area number.
can anybody suggested me some script to achieve this function.

Example display path message : "Area 5 sensor triggered"

I suggest you don't extract it from the display path, but use associated data instead.

Also, when you have an issue with a script... It's usually a good idea to show that script.
And don't screenshot it, post code, using the preformatted text tool: image

Thanks for suggestion can you provide some example for use the associated data.

Please check my script. I'm using the query to get the user information from database, this number is the parameter for my query.
I checked my query working fine when pass the area number from memory tag.

only part I need to pass correct area number when alarm triggered.

def calculateRoster(event, builder):
# Get the display path from the event
    display_path = event.getDisplayPath()
    def extract_Area_number(display_path):
        parts = display_path.split()
        for part in parts:
            if part.isdigit():
                return int(part)
        return None  
    area_number = None
    if display_path.startswith("area") and "sensor triggered" in display_path:
        Area_number = extract_area_number(display_path)   
    if area_number is None:        
        return []

you can configure associated data here:
image

image

Then access it in your roster script with event['area_number']

Thanks for your suggestion it's working fine now. :smiley:

I have other issue my pipeline send two mail notification for one event of alarm. Is there any setting I'm missing in my pipeline.

Again, we're not mind readers, we can't tell what's wrong with something we've never seen.

1 Like


I have attached my Log screen-shot. I always getting two notification each time when alarm triggered.

Again (again !), not mind readers.

Wild guess: Is the alarm on "auto ack" and you've used the same pipeline for "ack pipeline" ?
Or the same pipeline for "clear pipeline" and the alarm is someone being cleared instantly ?

We can't do much based on just that. You've exposed an issue, but absolutely nothing else.
To be of any real help, we'll need to see the alarm's configuration and the pipeline, at the very least.

2 Likes




Email4
I have attached the configuration picture for your reference. I thought log details enough. I have only one pipeline.

I appreciate the effort of screenshoting things, but...

Sure, I attached the picture