Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,332
Community Members
 
Community Events
185
Community Groups

What is the purpose of the Source field in Update Notes API?

For reference: https://docs.opsgenie.com/docs/alert-api#add-note-to-alert

 

The "source" field isn't returned when Notes are queried. The "source" in the parent Alert isn't updated. There's no corresponding "source" in the notes panel for each note. It appears this field is not used anywhere.

 

This leads to a followup use case: I'd like to have some logic in outbound webhooks to determine if the webhook should even be triggered depending on the contents/metadata of a Note. Currently there are no alert filters in webhook config that's actionable on Notes.

1 answer

1 vote
Allen Barnard
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 18, 2021

Hi @Richard Guo

 

The source field is an optional parameter and does not need to be specified. It is used optionally when the REST API is used to add notes, the intended value is meant to be the name of the service, system, or script that added the note.  For more information visit this page.https://docs.opsgenie.com/docs/alert-api#add-note-to-alert.

 

On your second point, the alert conditions filters do not work against notes, please tag the alerts you wish to be ignored by your webhook integration and configure your alert condition filters to check the tags,

 

Thanks and kind regards,

 

Allen

Hi Allen,

 

 the intended value is meant to be the name of the service, system, or script that added the note.

 

It has zero purpose when that field isn't presented anywhere for the note. I don't see it in the GUI, it isn't a returned field when I query for alert notes from API. This value is effectively discarded. How do I/custom code get this value back?


And as for not being able to operate on anything not at the alert level, that's unfortunate. I don't want to discard the entire alert just because I want to squelch an automated note from triggering downstream integrations.

Allen Barnard
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 22, 2021

Hi @Richard Guo

You are most correct it is not available in the GUI or in the List Alert Notes response.  The intended purpose of the field is to populate the alert log with the source of the note so that admins may determine the origin of the note.

The customSource can only be found in the alert log entry that is added to the alert when the note is added.  To retrieve it you will need to use the List Alert Logs API call, it will return an array of logs for that alert, you will need to filter for the type "Comment", the first comment log returned will relate to the most recent not added to the alert, you will need to use regex or sed to extract the name of the source and store it in a string variable.

As for your concern about not wanting to accidentally trigger downstream integrations, it would be best to open a chat using the chat bubble inside the Opsgenie app, our Support Engineer can arrange access to your Opsgenie instance to review your integration configs.

I hope this helps thanks and kind regards,

Allen

Like # people like this

Great, I think I can work with that.

The intended purpose of the field is to populate the alert log with the source of the note so that admins may determine the origin of the note.

It would help to have that sentence in the description of the field. Since by inserting a value, users typically expect to be able to get it back via the complementary "get" function/API/CLI.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events