Forums

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

How to use condition in rule based on webhook?

Sebastian Krzewiński
Community Champion
October 22, 2025

Hi!

I'm trying to setup automation rule which will be creating or editing existing Jira ticket based on incoming webhook data.

I created a rule with 'Incoming webhook' trigger and I'm able to catch incoming data to configured webhook. Example data for webhook looks like:
{
"title":"Test 1",
"ticketID":"78229s",
"description":"Description",
}

Logic for my rule should looks like below:
1. When rule will receive data find if exist ticket based on JQL: some_text_field ~ ticketID_value_from_webhook
2. If ticket don't exist -> create new ticket
3. If ticket exist -> update values in ticket based on data from webhook.

How I can create "check if ticket exist" logic? I'm stuck on it and I don't know how I can achieve this.

Regards,
Seba

3 answers

0 votes
Bill Sheboy
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.
October 22, 2025

Hi @Sebastian Krzewiński 

As a variation of the other suggestions offered...

When you check for any existing matches to the ticketID value in the webhook data, what should happen when there are multiple matches found?

  • trigger: incoming webhook (with custom data)
  • action: lookup work items, with JQL to match to the field
  • if / else block
    • advanced compare condition, testing if {{lookupIssues.size|0}} equals 0
    • action: create work item
  • else / if
    • advanced compare condition, testing if {{lookupIssues.size|0}} equals 1
    • branch: on JQL to the work item key from {{lookupIssues.first.key}}
    • action: edit work item
  • else:
    • ??? what to do when there are multiple matches found ???

 

Kind regards,
Bill

0 votes
Gor Greyan
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.
October 22, 2025

Hi @Sebastian Krzewiński

Such an interesting automation.

One question: what is the TicketID there? Is it a custom field or something else?

If it is a custom field, I think this smart value will work.

some_text_field ~ "{{webhookData.ticketID}}"

Put this into the lookup issue

Then, via the compare condition check

{{lookupIssues.size}} greather then 0

Create Issue

Else

Edit issue fields:

Summary: {{webhookData.title}}
Description: {{webhookData.description}}

0 votes
Ignacio Vera
Contributor
October 22, 2025

Hey Seba!

 

Try this

Trigger: Incoming webhook

Create variable: ticketId = {{webhookData.ticketID}}

Lookup issues:
project = ABC AND "Some text field" ~ "{{ticketId.escapeJql}}"

IF {{lookupIssues.size}} = 0

Create issue:

Summary: {{webhookData.title}}

Description: {{webhookData.description}}

Some text field: {{ticketId}}

ELSE

Advanced branch: {{lookupIssues}}

Edit issue fields:

Summary: {{webhookData.title}}

Description: {{webhookData.description}}

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events