The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Example of creating a web hook via atlassian-connect-spring-boot

el_moreno
April 14, 2023

I am trying to create a web hook programmatically using atlassian-connect-spring-boot. In the documentation, the following is specified:


@Autowired
private AtlassianHostRestClients atlassianHostRestClients;

public void doSomething() {
    atlassianHostRestClients.authenticatedAsAddon().getForObject("/rest/api/example", Void.class);
}

I changed it to postForOject as the creation of a web hook is a POST  but I get a 400 Bad Request, which I guess means the payload I am passing is wrong but I get no other details, my payload is as follows (Apologies about the format), which I found here


{
"url": "https://your-app.example.com/webhook-received",
"webhooks": [
{
"events": [
"jira:issue_created",
"jira:issue_updated"
],
"fieldIdsFilter": [
"summary",
"customfield_10029"
],
"jqlFilter": "project = PROJ"
},
{
"events": [
"jira:issue_deleted"
],
"jqlFilter": "project IN (PROJ, EXP) AND status = done"
},
{
"events": [
"issue_property_set"
],
"issuePropertyKeysFilter": [
"my-issue-property-key"
],
"jqlFilter": "project = PROJ"
}
]
}
I have also tried doing:

atlassianHostRestClients.authenticatedAsAddon(AddonAuthenticationType.OAUTH2).getForObject("/rest/api/example", Void.class);
 
and for this one I get a 401.
So, any example out there on how to create a dynamic web hook using atlassian-connect-spring-boot?!?!?! I have looked in the documentation and online and nothing and this has been blocking me for days now. Any help would be appreciated!

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events