Jira issues not coming through from Bitbucket webhook
Asked by Joy Paul:

I am using Jira Automation to automatically move a ticket to a certain state (Code review Completed) when a PR is approved in BitBucket. I have generated a webhook in BitBucket with PR Approved as a trigger. This hook is then used in Jira Automation to move the issue to Code Review Completed state. However, when the PR approved event is triggered, no Issues object is getting passed from the hook and hence Jira Automation is throwing an error - "No issues from the webhook". Can someone help?


Answers:
author: Patrik S
body: Hello [@Joy Paul](/t5/user/viewprofilepage/user-id/5147288) ,

Welcome to Atlassian Community!

I'm afraid that currently, the Pull Request:Approved webhook JSON payload does not contain a specific ***issues*** object to be interpreted by the Jira automation. The issue key is only returned in the title of the PR, in case was included there, but Jira won't really look for that field.

I went ahead and created a feature request to include the ***issues*** object on the Pull Request webhook payload, which you can find in the following link :

* <https://jira.atlassian.com/browse/BCLOUD-22484>

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with [this policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) in mind.

While this feature is not implemented, we have Automations developed for other Pull Request events, such as Created, Merged or Declined. These can be found directly in the Jira automation page and do not require you to manually configure a bitbucket webhook :

![Screenshot 2023-02-16 at 5.09.37 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/240747iBB104A34E120826C/image-size/large?v=v2&px=999 "Screenshot 2023-02-16 at 5.09.37 PM.png")

Hope that helps!

Thank you, [@Joy Paul](/t5/user/viewprofilepage/user-id/5147288) !

Patrik S

comments: author: Joy Paul
body: Thanks for your response Patrik!

Yes, I have already implemented all other PR events, except Approved :)


author: Yuval Ginat
body: Hey [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) , I can suggest a different approach as I am also facing this exact issue.

You can bring up another web service as "middleware" between the Bitbucket trigger and JIRA automation. For example some simple flask server.

In this middleware API (that you triggered from the pull request event) you can process the body of the request into a format that JIRA automation can handle and send it to the the automation rule to trigger a status change for the issue (or any other action supported there).

Hope this helps!


author: Diana_Architect_ZigiWave
body: [@Joy Paul](/t5/user/viewprofilepage/user-id/5147288) hi, did you resolve your issue? Yuval's approach should work. There is also another option, if you're willing to explore the 3rd party tools at the Atlassian marketplace - check out [ZigiOps](https://zigiwave.com/jira-bitbucket-integration/?utm_source=atls-jbtb&utm_medium=atls-jbtb&utm_campaign=atls-jbtb&utm_id=atls-jbtb). It might be helpful.

BR, Diana


Tags: bitbucket-cloud

cloud