way to import event rules

dio1
Tera Contributor

Is there a way to import event rules all at once?
I need to create about 600 event rules.
If possible, I would like to create them using easy import. However, methods other than easy import are also fine.

3 REPLIES 3

Mark Manders
Giga Patron

It's the em_match_rule table, but I think you will have a hard time importing it like that, unless everything is in the correct format already.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Tanushree Maiti
Mega Patron

Hi @dio1 ,

 

Please refer community post : Event Management Rules - changes to rules using XML export/import? 

 

Netta from Servicenow  Event Management team already confirmed this.

 

"I understand your use case, and still I must emphasize that using import/export in order to change and edit event rules is highly not recommended. As you mentioned, it can be very dangerous to edit the rule xml and by mistake damage the rule.
If you still want to use import/export, please use it carefully.
The reason that the transform and compose sections were missing from the xml file, is that there are separate tables of transform (em_match_field) and compose (em_compose_field). You need to navigate to each table, look for the records that are associated to the specific event rule and export them. There should be a record per field with a regex."

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

JulietD
Mega Guru
  • Export a couple of existing Event Rules from the target table to use as a template.
  • Prepare an Excel/CSV file with all required fields (e.g., name, event name, source, severity, etc.).
  • Go to System Import Sets → Load Data and upload the file.
  • Create a Transform Map to map fields from your file to the Event Rule table.
  • Run the transform to create all records in one go.