Forum Discussion

mnagel's avatar
mnagel
Icon for Professor rankProfessor
6 years ago

integration data transformation via Groovy

There are times when field values in LM do not match expected field values in integration targets and it would be handy to have an option within the integration to transform data when necessary.  Ideally, this would be via the template feature that doesn't yet exist, but it could be done now if the integration data was processed optionally as a Groovy script.  A practical example of this is for PagerDuty, where they can accept a severity field.  Unfortunately, the values do not match for ##LEVEL## to what PagerDuty expects, so it is a non-starter.  If we could execute a Groovy script instead, it would be possible to adjust the values before submitting to the PagerDuty API.  I envision this as an option in the integration data field where it would be 'plain text' for the current method and 'Groovy script' for the proposed method.

2 Replies

Replies have been turned off for this discussion
  • Hey Mark,

    For the PagerDuty situation and their V2 of the API we are aware of this and working with PagerDuty on some updates to our Integration.  I hear you on the on the bigger picture item though and will enter a feedback ticket in our system to track the request.

    ~Forrest

  • What I'd like is something similar to how scripting is supported in web service checks. Particularly for HTTP integration.  If the script option is selected, then you get a template script and the script context has access to an "alert" object which has all the alert info you would expect from an alert object (i.e. same as the alert returned by the API).  As with web service checks scripting, the return value of the script would be the HTTP request payload passed to the integration, which is what I'd want to programmatically define in the script (JSON, XML, whatever).