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

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events