Hi,
I am trying to create an Automation that performs an action, based on the value of a field within the {{webhookResponses.body}}
My requirement is to perform an action based on the totalItems field in the body field of the response, which can be see here
I can access the field successfully, as shown by the following, which is displayed in Audit Trail by the Log command
But when I try an "if" statement, it doesnt seem to work
Any clues/tips on what I am doing wrong with this would be appreciated
thanks
Did you try to log {{webhookResponses.body.totalItems}}?
Just to check that it prints "0"?
If yes, can you show the log?
Share more clear screenshots?
Thanks
Hi @Nir Haimov
yes, I have Logges the totalitems, and confirmed that it prints 0
here are a clearer examples of the log
thanks
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to log the following:
{{webhookResponses.body.totalItems}} == 0
And also in different log:
{{webhookResponses.body.totalItems}} == "0"
Let me know the outcome
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nir Haimov , Im not clear on how to incorporate that into an IF Block with the Jira Automation function
Is this what you meant ?
(it didnt work)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, that's what I meant.
What do you mean it didn't work?
What the log print?
Did you also try 0 (without quotes)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nir Haimov I have tried 0 with and without quotes
Here is an exampled of my code
So, as you can see, I Log the field value, and then I have and IF Statement to check the field, using quotes, and no quotes, and then and ELSE Statement to catch it, if it falls through
Below is the Log after execution
As you can see, it Logs the field value (0), then doesnt match the 2 IF Statements, and executes the ELSE Statement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but I really don't know, I tried similar thing in the past and it worked.
Hard to try fix something that you can't actually touch (but I tried) :)
Try to open a ticket about it to Atlassian.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nir Haimov .I got to the bottom of it
I was checking the wrong field in the IF Statement !!
I left out the ".data." in the field name
thanks for your time and effort
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.