Jira Oauth 2.0 connected app

Nishant Sharma August 25, 2022

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
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 28, 2022

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2022

Yep - that's right!!

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

 Thanks @Prince Nyeche 

Nishant Sharma August 29, 2022

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 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

Nishant Sharma August 26, 2022

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]"
            ]
        }
    ]
}
mahendar akarapu April 16, 2024

Hi @Nishant Sharma 
Have you got a solution for this problem?

Suggest an answer

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

Atlassian Community Events