mnagel

integration data transformation via Groovy

Recommended Posts

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.

  • Upvote 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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). 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now