Ive created a rule using the Github Webhook with the "Pull Request Reviews" and "Pull Request" events selected to automate the process for moving the JIRA issues to "QA" when a pull request is "approved" in Github
However, it doesn't work as expected. For some reason the payload that got sent and shown in the Rule Audit log in JIRA doesn't include the "action" or "state" like "approved".
Here is the rule conditions
Has anyone tried something similar? Any ideas / suggestions are helpful and very much appreciated !!
I got an update from the JIRA Support on this issue and would like to share here so it might save some of your in case you run into the similar or related issue when using Webhook with A4J.
It turned out that this is a known bug in automation for Jira (A4J) that ignores the incoming webhook headers and the state of the PR is provided inside the webhook header and this information is completely removed from the incoming webhook when being processed by A4J.
As an FYI, here is the ticket that was created to address this problem: https://jira.atlassian.com/browse/JRACLOUD-76534
BTW, @Simmo has reported that issue back in 2019 https://codebarrel.atlassian.net/browse/AUT-1826 it's still in Backlog till now :(
Hope it gets prioritized and fixed sooner this time.
Thanks to ALL who help with the feedback and for sharing your expertise!!
Best,
Olga
Hi, is there now a workaround for this? I need help to automate the creation of dependabot tickets from GitHub to Jira using webhooks but the payload that got sent and shown in the Rule Audit log in JIRA doesn't include some fields like 'security_advisory' in my case, please check this out for more details, I asked a question about this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply @Simmo !!
Now that I know that there are no access permissions involve then I've moved on and tried the @Darryl Lee suggestion.
So I have created a rule and im getting data like the Pull Request number , State (e.g. OPEN) in the Webhook payload json . However, the Pull Request Reviews events that i'm looking for e.g. PENDING. or APPROVED or are not there
Here is what I'm expecting based on the Github documentations:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Olga Buslovich , could you provide an example of what you're getting? That's the easiest way to figure it out.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm afraid its been cut off, so its hard to tell but one thing to check is if the information that you're after has been included. With github, some information is optional and needs to be ticked to be included in the webhook.
Cheers,
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank YOU @Simmo !!
Actually the Log I've shared has all the data that i got (no cut off ). I'll open a ticket with Github. Thanks again!!
Best,
Olga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey there:
Would you be able to paste in the URL (feel free to obscure the hostname) of your webhook request?
I'm thinking that you might not need pull_request_review as that's part of the URL, not what gets returned by the request.
(Reference: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review)
So then, I would try adding a "Log action" of:
State: {{webhookData.review.state}} / Action: {{webhookData.review.action}}
To see if that's returning what you're looking for.
(Learn more about "log action" in the Debugging your first rule documentation.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OH. Reading the article How to integrate Jira and GitHub using Automation for Jira, @Simmo actually includes pull_request in Smart Values used for creating an issue from a webhook.
I guess the best way to check for sure whether you need to include pull_request_review is to follow the same steps, which is to add a "Log action" of:
{{webhookData}}
Which will allow you to see the full JSON payload, and then figure out what Smart Value you should use to get "state" and "action".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you can do this and paste take a screenshot or paste what the JSON payload is (obfuscating any confidential data), we could help figure out what the Smart Values should be.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response @Darryl Lee !!
Actually, I was using the @Simmo article as a base for creating conditions in my rule and found very helpful - Thanks @Simmo !!
Before going any further, I'd like to double check if there are any additional permission / access level requirements on the Github side needed to be able to receive and see all the webhook actions / events for the JIRA user who is the owner of the rule?
For Exp, I have Admin privileges for JIRA but I do not Admin for the Github repo and I've asked the Dev Team Lead to create the Webhook for me b/c i do not have the admin permissions for that repository. Is this could be a problem for me not getting all the events / actions in the JSON payload?
Please advise.
TIA!!
Olga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Olga Buslovich,
You shouldn't have any issues with that. Webhooks are not authenticated so you'll be able to receive it okay.
To try and figure out your smart values, take the advice from @Darryl Lee and log out the webhook data. That will show you everything you can access.
Cheers,
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi - I was doing some work with a client who had connected their Github instance to Jira using the built-in integration, which I believe eliminates the need to get pull request information via a Webhook.
https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-github/
Is there a reason why you can't use that integration?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Darryl Lee ,
Thank you for following up!!
I've took a look and I believe that our JIRA is already connected to the Github (see attached screenshot).But I'm not sure how to use this integration in creating the automation rule that will move JIRA issues to a certain state e.g. "Awaiting Code Review" or "QA" when PR gets set to "Request Review" or "Approved" in Github.
I would really appreciate if you share any additional info on that
TIA,
Olga
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.