Problem: I have configured github to send a a post to a Jira Webhook automation rule and while the automation rule is finding the correct issue in Jira via JQL and smart values {{webhookData.pull_request.head.ref}}. The conditions in the webhook automation rule are not matching for some reason
the conditions in the rule are configured as follows
First value: {{webhookData.pull_request.merged}}
Condition: equals
Second value: true
First value: {{webhookData.pull_request.base.ref}}
Condition: equals
Second value: dev
First value: {{webhookData.pull_request.action}}
Condition: equals
Second value: closed
I have looked at the conditions and looked at the json and looked at smart values, and I can't seem to find a reason why this rule will not work. I could use a second set of eyes to tell me what I am doing wrong.
Hello @Christopher Y. Horvat ,
I noticed something while your comment you reference "{{webhookData.pull_request.head.ref}}"
In the screenshoots reference is made to "{{webhookData.pull_request.base.ref}}"
Just to confirm, is base.ref correct instead of head.ref?
From experience I would say that if a rule says that it fails, it is because it fails, that is, because the value is not what was expected.
How sure are we that these values are sent and reach the automation at that exact point with the expected value?
To debug, I invite you to try the following.
You can create some initial variable at the beginning of the automation where you store the information that arrives in the different variables that you hope to check, otherwise, you can apply the solution directly.
{{webhookData.pull_request.merged}}
{{webhookData.pull_request.base.ref}}
{{webhookData.pull_request.action}}
And while we're at it, why not too?
{{webhookData.pull_request.head.ref}}
Now, use a new action to add a comment to the task with the values of these variables before checking. If those variables have data, they should be added to the comment, which will allow you to know what it contains at that exact point of execution.
Ultimately, I would check the type of the values. It wasn't really checking "1" vs "true".
The truth is that it is very clear and I can't think of anything else, I hope it can be of help.
Regards,
Sergio G.
I will give that a try so I can see the values as Jira is seeing them. But I have looked at the JSON payload from github and the values are definitely boolean and strings. So not sure why the if statement is not matching.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to Sergio, I was able to determine what I was missing with my own to eyes. The smart value I was using for action {{webhookData.pull_request.action}} is not an actual value, it should have been {{webhookData.action}}. Once I fixed that the conditions started working as expected and we now have github base and ref based issue transition rules! Yay!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm glad I could help and share something new! It's happened to me too—being 100% sure about a value, but nothing beats seeing it at runtime. 😉
If you ever have any more questions, don't hesitate to ask! We're always here to help.
Regards,
Sergio G.
Abyyba Team
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.