Register Dynamic webhooks for all projects

Moti Lahiani September 12, 2024

Hello

I am using rest api to register for webhooks using the request body
What should I write in the jqlFilter to register for ALL projects?

POST https://api.atlassian.com/ex/jira/<cloud ID>/rest/api/3/webhook 

{
  "url""<callback URL>",
  "webhooks": [
    {
      "events": [
        <list of event>
      ],
      "jqlFilter""<jql to include all project keys>"
    }
  ]
}

can i use regex like "jqlFilter: project = *"? or "project = all"?

1 answer

0 votes
Lígia Zanchet
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 19, 2024

Hello Moti

In JIRA, when you're constructing search queries, specifying the project is optional. If you don't explicitly mention a project, JIRA will search across all projects by default.

Example Scenarios:

Search Within a Specific Project:

Query: project = XYZ and issuetype = Bug

This query will filter and display all issues of type "Bug" within the "XYZ" project. Use this when you want to focus on a specific project.

Search Across All Projects:

Query: issuetype = Bug

This query will look for all issues of type "Bug" across your entire JIRA instance, regardless of the project. This is useful when you're interested in a particular issue type across your organization.

By tailoring your search queries, you can efficiently locate the information you need, whether it's focused on a single project or spans multiple projects.

Thanks for post in our community 

 

Moti Lahiani September 23, 2024

Hi Ligia
Thankss for your answer, this i am familiar already, Maybe I wasn't clear enough in my question :) so i'll try to explain and maybe expand it a bit. 

according to jira docs the jqlFilter is mandatory, i need to register dynamic webhook that will fit all issues (new/updated/existing) in all project with no other terms, if it issue and the event is occur i want a webhook to be send on it

1. what should be the jqlFilter to get "ALL ISSUES" existing and those will be created  in future?

2. does the jqlFilter support regex? like jqlFilter:  project = * or project: issue = *

3. in case registering to all projects/issues, in manner of security, does webhook will be send on project/issue that the webhook creator has no access to?
for example:
Customer has prog1, proj2 and proj3 projects in its jira 
A user that have access to only proj1 and proj2 dynamically register a webhook to all projects with event: "jira:issue_updated"
does it get webhooks on issues from proj3?

Thanks

Lígia Zanchet
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 26, 2024

Hello Moti

Thank you for your questions
Allow me to answer it:


1. what should be the jqlFilter to get "ALL ISSUES" existing and those will be created in future?

An empty JQL.
Imagine that Jira default JQL is select *.

Everything you added after it, is filtering like it is inside the where 

2. does the jqlFilter support regex? like jqlFilter: project = * or project: issue = *

JQL filter doesn't support regex. 

3. in case registering to all projects/issues, in manner of security, does webhook will be send on project/issue that the webhook creator has no access to?
for example:
Customer has prog1, proj2 and proj3 projects in its jira
A user that have access to only proj1 and proj2 dynamically register a webhook to all projects with event: "jira:issue_updated"
does it get webhooks on issues from proj3?

Webhook will only return issues that you have access based on the user that triggers the event 


Hope that clarifies your questions 

Moti Lahiani September 30, 2024

Hey Again :)
Thanks for detailed answer

Regarding answer 2:
when using rest api to dynamically register for webhooks the doc mention that the jql is mandatory so did you mean to write it as:
jqlFilter: "" 

Thanks

Lígia Zanchet
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 2, 2024

Hey Moti

Leave it empty should solve this

This JQL matches all issues in all projects

If you leave the JQL query empty, it'll match all issues from all projects. This means the webhooks we'll send may reveal sensitive information.
Ignore this warning if that's what you meant to do.

 

Thank you 

sangeetha
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 26, 2024

Hi @Lígia Zanchet ,Jira webhook.png
I tried to register a Jira webhook with the empty "jqlFilter" in the request body, but I received the error "JQL search not supported." This is because I need to register a dynamic webhook that will fit all issues (new, updated, or existing) in all projects with no other terms. Would you kindly check this once and provide the example code here?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events