I noticed when I run this script on an existing tag, that it deletes the existing alarm states that are setup. I am only trying to edit the alertmessagemode and the alertmessagesubject. Not sure if this is a bug or if I was just under the impression that we could edit individual parts of the attributes without having to declare all of the attributes.
query = "select devicename from devices where devicename = '6090431'"
res = system.db.runQuery(query)
for row in res:
identifier = row[0]
system.tag.editTag(tagPath="%s/volts" % identifier, attributes={"AlertMessageMode":1, "AlertMessageSubject":"{%s/Location} {%s/Volts.Documentation} Alarm" % (identifier,identifier)})