Forums

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

Jira Automation condition from incoming webhook data

Michael Savedra July 14, 2022

Hi guys!

I'm looking to implement conditional logic for a jira automation triggered by a web hook based on the datat specified in the payload.

 

For example, with this json body being recived: 

"{

"collect_from": {
"name": "Joe Smith",
"address_lines": [
"1 Test Road",
"Portsmouth"
],
"postal_code": "PO0 4XX"
},
"notification_email_address": "customer@company.com",
"notification_phone_number": "07171071071",
"number_of_boxes": 2,
"created_date": "2022-07-05 13:32:59",
"booked": "true",}}", 
I want to set a JQL condition for "IF {{webhookData.booked}} ~ "true" THEN do X. Sadly I'm getting an error that says "
No subsequent actions were performed since JQL condition did not pass due to error running JQL: Invalid JQL: true ~ "true" so it looks like it's finding the correct value, just need the correct JQL for what I need?
Any help would be most appriciated.
thanks!
Mike

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall
Community Champion
July 14, 2022

Hi @Michael Savedra - A JQL condition won't work because the JQL will not execute against the webhook.  Instead, you'll want to use an advanced condition like this:

  • {{webhookData.booked}}
  • Equals
  • True
Michael Savedra July 15, 2022

Thanks Mark, I'll give that a go now and let you know!

Michael Savedra July 15, 2022

@Mark Segall

Hey, the issue I'm having with the advanced compare is that the second value after equals needs to be reresented as a string value, and doesn't seem to be getting recognised because of this:Screenshot 2022-07-15 at 10.44.35.png

Tried with and without the quotations. is there a better way to represent the value "true"? Possibly using another smart value/ regex value? 

I have a work around to add the values form the webhook data to a text field and then base the condition off the contenbts of the field, but I think this way would still be much cleaner if possible. 

Let me know, thanks!

Michael Savedra July 15, 2022

Also I tried with contains to see if tht would pick up the text, also tried with capatalisd and lower case string.

Mark Segall
Community Champion
July 15, 2022

What happens if you use this as your first value?

{{webResponse.body.booked}}

I typically breakdown my responses from the Send Web Request action with webResponse.body.xxxx  and it works flawlessly.

Michael Savedra July 18, 2022

Hey @Mark Segall  thanks for getting back to me. 

No dice with that I'm afraid, to clarify this is for an incoming webrequest so I'm not sure it would be able to access teh response as part of the automation? More needing to analyse the data from the incoming hook. 

Do the values true and false need to be represented as string values withing the advanced compare block as they are presented as strings within the data payload? 

Thanks in advance

Mark Segall
Community Champion
July 18, 2022

Ahh - I'm understanding now.  I thought you were using the send web request action to get the data. I didn't realize this was using the native webhook functionality.  I don't think automation will be able to link to the native webhook action, so I think your workaround is the only way to go on this one. 

Am I correct to assume that you're using the native webhook instead of the send web request action because you want near real-time updates and/or dealing with a large data set?  I ask because if this is not the case, it may make sense to try the API call with the send web request action instead. 

Michael Savedra July 18, 2022

Hey  @Mark Segall , 

Yeah i'm using the native incoming web request to receive ad-hoc updates from one of our suppliers (who won't be able to access the api directly).

Thanks for taking the time to look into this!

Like Mark Segall likes this

Suggest an answer

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

Atlassian Community Events