# Ignore schedule on alarm roster users

**URL:** <https://forum.inductiveautomation.com/t/ignore-schedule-on-alarm-roster-users/18587>\
**Category:** Ignition\
**Created:** [June 22, 2018, 7:53pm UTC](https://forum.inductiveautomation.com/t/ignore-schedule-on-alarm-roster-users/18587 "2018-06-22T19:53:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [June 22, 2018, 7:53pm UTC](https://forum.inductiveautomation.com/t/ignore-schedule-on-alarm-roster-users/18587/1 "2018-06-22T19:53:19Z")

</div>

Is there a way to create a notification block that will ignore a user’s schedule when sending notifications?

I am wanting to create a high-priority notification pipeline that will call a small number of key personnel regardless of their schedules. I’d like to retain the schedules on the users for the run-of-the-mill alerts though.

I think I can do this with a scripted roster, but I didn’t know if there was some simple property I was missing to let me do this a bit easier.

Thanks,  
Brian

---

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [June 23, 2018, 9:09pm UTC](https://forum.inductiveautomation.com/t/ignore-schedule-on-alarm-roster-users/18587/2 "2018-06-23T21:09:11Z")

</div>

The code I ended up coming up with was this:

```auto
	rosters = system.alarm.getRosters()
	users = rosters.get("Emergency Call")
	scriptedRoster = []
	for person in users:
		user = system.user.getUser("default",person)
		userContactInfo = user.getContactInfo()
		phoneNumbers=[]
		emailAddresses=[]
		smsNumbers=[]
		for item in userContactInfo:
			if item.contactType == 'phone':
				phoneNumbers.append(item.value)
			if item.contactType == 'email':
				emailAddresses.append(item.value)
			if item.contactType == 'sms':
				smsNumbers.append(item.value)
		rosterEntry = {"username":person, "firstname":user.get(user.FirstName), "lastname":user.get(user.LastName)}
		if phoneNumbers:
			rosterEntry["phone"] = phoneNumbers
		if emailAddresses:
			rosterEntry["email"] = emailAddresses
		if smsNumbers:
			rosterEntry["sms"] = smsNumbers
		if not phoneNumbers:
			break
		scriptedRoster.append(rosterEntry)
	return scriptedRoster

```

It pulls the user list for a specific roster name from the overall roster list, then gets the relevant info for each user. In my case, I was only wanting users that had a phone number configured, so I added a break to the loop before the script adds the completed user to the array. If you want all the users from a roster, just remove that section.

---

<div class="post-metadata">

**Author:** ![j.israelsen](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@j.israelsen](https://forum.inductiveautomation.com/u/j.israelsen)\
**Post date:** [October 15, 2019, 3:13pm UTC](https://forum.inductiveautomation.com/t/ignore-schedule-on-alarm-roster-users/18587/3 "2019-10-15T15:13:50Z")

</div>

This solution worked great for me. Thanks for the code.

---

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [October 16, 2019, 3:25pm UTC](https://forum.inductiveautomation.com/t/ignore-schedule-on-alarm-roster-users/18587/4 "2019-10-16T15:25:20Z")

</div>

I’m glad someone was able to use it!
