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,365,210
Community Members
 
Community Events
168
Community Groups

Jira Oauth 2.0 connected app

Hi Team,

 

I want to register webhook for these events using Jira REST api v2.

1. project_created

2. project_updated

3. project_deleted

 

These events does not accept JQL. So When I removed the JQL part from request body it is not allowing me to register webhook for these events.

request payload I am trying and relative api url (/rest/api/2/webhook)

{
    "webhooks": [
        {
            "events": [
                "project_created"
            ]
        }
    ],
}

 

can someone pls help me to correct the payload structure or any document references which show how we can register webhook for these events.

 

Any help on this would be appreciated.

 

Regard,

Nishant 

2 answers

0 votes

You should look into the official documentation for proper formatting. There are examples shown there. I believe it should come with a prefix "jira:"

Pramodh M Community Leader Aug 28, 2022

Yep - that's right!!

'{
"webhooks": [
{
"events": [
"jira:project_created"
]
}
],
"url": "https://your-app.example.com/webhook-received"
}'

 Thanks @Prince Nyeche 

Hi @Pramodh M / @Prince Nyeche ,

I have tried your suggestion, but still it does not work. I have checked the documentation as well but seems to be "jira:issue_created" is kind of representation for only specific types of events.  if you talk about "comment_created" event it works without prefix of "jira:"  and same goes with "project_created" event.


I am getting below error for the above suggestion:

{
    "webhookRegistrationResult": [
        {
            "errors": [
                "Invalid event ids specified: [jira:project_created]"
            ]
        }
    ]
}

 

0 votes
Pramodh M Community Leader Aug 26, 2022

Hi @Nishant Sharma 

Try providing the empty JQL with empty string and passing the body

'{
"webhooks": [
{
"jqlFilter": "",
"events": [
"project_created"
]
}
],
"url": "https://your-app.example.com/webhook-received"
}'

Let me know if it worked

Thanks,
Pramodh

Hi Pramodh M

I have tried your suggestion

API Request:

{
     "webhooks": [
      {
         "jqlFilter""",
         "events": ["project_created"]
      }
    ],
}
API RESPONSE:
{
    "webhookRegistrationResult": [
        {
            "errors": [
                "Invalid event ids specified: [project_created]"
            ]
        }
    ]
}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events