Missed Team ’24? Catch up on announcements here.

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

What are the variables I send through webhooks when using the "agent online" system notification

Jonathan Ghellere May 20, 2022

Hello,

There are "System Notifications" for the events "Agent Online" and "Agent Offline". We can choose Webhooks as "Recipient Type" and then select a Webhook Template.

I'm not finding anywhere which variables I can send in the body as a POST request when using a Webhook Template. For instance I'm interested in the agent name. I'm mean, if the agent is online, then I would like to know at least it's name. : )

Has anyone been able to achieve this somehow?

 

ps. I was able to set a custom capability on the agent:

"my.name" = "${HOSTNAME}"

Then I've created a template like:

{
"uuid" : "${bamboo.webhook.uuid}",
"hostname" : "${bamboo.capability.my.name}"
}

I get a "variable not found" in the logs.

1 answer

0 votes
Jonathan Ghellere May 24, 2022

Looks like the webhook does not get the capabilities from the agent but only the local ones(from Bamboo Host/Server/DC). For instance, let's say I have a server capability called:

TEST=ABC

But this capability does not exist in the agent. If I try to use it in the webhook:

${system.capability.TEST}

Then I will get the value "ABC". If the variable does not exist in the server but exists in the agent I get a "variable not found".

I'm not sure if this is a BUG or it is how it's supposed to work. I mean, we have an event called "Agent Online" but when I try to use the Webhook as a recipient type, it does not receive any data from the agent.

If so, it would be good to have the recipient type Webhook removed from the list of possible options. : (

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events