Feature Idea: Custom Payload Variables

Is there a built in variable to get targets[0].name while creating a custom payload.

New Relic edit

  • I want this, too
  • I have more info to share (reply below)
  • I have a solution for this

0 voters

We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.

Hi Anuc, right now there is not. Can you tell me a little big about your integration where having access to this as a variable would be helpful?

Just trying to retrieve the server name that violated the condition.

Gotcha, thanks.

Well…the reason targets is in an array is that in the future more than one resource target could be the reason for the incident to open. Until then, the targets array will only have a length of 1. Does that help?

When the policy is created to trigger events “By condition and target”, I thought there will be only one resource target. Correct?
If that is the case the array length will always be one and hence my question as to how to get resource target name

The webhook payload doesn’t change, even if you choose a different incident preference, it will always be an array.

targets[0].name is the best way to get the name of the resource that caused the violation.

I got a similar problem, is possible to put 'target[0].name in the webhook custom payload? I’ve tested, it seems not working.

@ping_hu what is the piece of information you’re trying to send in the custom payload? Are you aware of the doc we have that has all of the variables you can send in the payload? I would check in there to see if you can find what you’re looking for

1 Like

Any update on this? My team has a similar requirement for integrating NewRelic alerts into our centralised monitoring system.

Seems like a straight forward ask:

  1. allow custom payload to support nested references to $TARGETS, example: $TARGETS[0].name


  1. expose some other variable which holds the value for TARGETS name.

Understanding that these would probably only work is Alert Policy is set to “By condition and entity” if the user wants a single value instead of a list.

Hi @Alex_Pena! I see that you also have a support ticket open and are speaking directly to our Alerts experts regarding this. Once this gets all sorted, please come back to this thread and give us all (in the online technical community) the update regarding the progress! Thanks so much, hope to hear back soon.

Any update on this?

I’m doing an integration with various services and would be very useful if I could use Target [0] .name.

No update to share right now, @jefferson.silva! Thanks for sharing your use case—I am passing your input along to our product team right now. Thanks again and check back soon.

Any update on this ? I am trying to use Target[0].name as well for a integration.

Nothing to share on this today, @alohani! Thanks for letting us know you would also benefit from this. Please be sure to vote above and keep checking back. :blush:

Has this been implemented?

Not yet, @anthony.allen. If you have a use case to share, please feel free to reply to this thread. Also be sure to vote above! Thanks. :blush:

@Linds I am trying to build out a webhook to integrate with my companies ticketing system, and I need the application name ($TARGETS[0].name) to bind it to configuration item. The current setup slows down the time it takes to create a ticket due to it having to parse out the information that is needed from $TARGETS instead of just letting me send the necessary information in the original payload.

1 Like

Great! @anthony.allen - adding this to the request I sent along for you yesterday. Thanks!

I need to be able to show the Entity that created the alert in a webhook payload. It apears from this thread that the TARGETS object contains tht info, but only as a JSON object and that there is no way of just extracting the Name property. If there is any way of achieving this please let me know.

Hey @mike.dymond - you can check out the docs on Custom Payloads to see what is currently supported; https://docs.newrelic.com/docs/alerts/new-relic-alerts/managing-notification-channels/customize-your-webhook-payload

There is currently no way to extract individual elements of the $TARGETS JSON segment.

1 Like