go-pagerduty icon indicating copy to clipboard operation
go-pagerduty copied to clipboard

Support for creating Event Rules with "Template Extractions", via go-client library

Open ricardoasmarques opened this issue 3 years ago • 4 comments
trafficstars

According to the API documentation, it's possible to create an "Event Rule Extraction" using a template (instead of a regex):

Screenshot from 2022-02-07 11-39-49

This same option is available when creating an Event Rule via UI;

Screenshot from 2022-02-07 11-41-21

But It's not possible to do it via go-client library:

Screenshot from 2022-02-07 11-45-19

Is it possible to add support for creating "Event Rule Extraction" using a template, via go-client library?

ricardoasmarques avatar Feb 07 '22 11:02 ricardoasmarques

@ricardoasmarques can you please point me more precisely within the documentation where it says a template can be used? I took a look at the link, expanded all fields, and do not see template anywhere on the page.

The reason I ask is that a requirement for functionality being added to this package is that it's clearly documented on that API docs site.

theckman avatar Mar 21 '22 01:03 theckman

Also, sorry for not replying sooner. I somehow missed this issue. 🤦‍♂️

theckman avatar Mar 21 '22 01:03 theckman

@theckman it's a bit hidden in the documentation.

You have to navigate to https://developer.pagerduty.com/api-reference/b3A6Mjc0ODIwNw-create-an-event-rule-on-a-service and then expand rule > actions > extractions, then you will see a dropdown next to the extractions field:

Screenshot from 2022-03-21 08-59-41

Select the second option on that dropdown, and you will see the documentation for template:

Screenshot from 2022-03-21 09-06-33

ricardoasmarques avatar Mar 21 '22 09:03 ricardoasmarques

Yikes. So looking at that we're probably going need a breaking change to support this. 🤦 I guess we could add the field, and add a check for both target and regex being set... if so then return an error.

theckman avatar Mar 22 '22 04:03 theckman