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
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?
Kind regards,
Bill
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}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.