Bitbucket new webhook not working - bitbucket

Bitbucket has improves its Webhooks functionality. We won't be able to create POST or Pull Request POST in Services, instead in Webhooks.
So I have tried to create POST request to Slack using new Webhook, but it doesn't work. Clicked on View requests, I got 500 error on the request. While with the same URL, it works in Services.
I don' know what I did wrong. Bitbucket documentation doesn't help. Can someone please help me?

I'm experiencing the same problem, and it appears to be a known issue with the integration (from the perspective of Slack).
As documented on slack.com:
This integration only supports the Repository push trigger at this
time, so make sure it is selected. Press Save when you're done.
I'm not sure where to find a public link to this document, but you can find it if you go to add the bitbucket integration. And the documentation on slack appears to be up to date with the new bitbucket webhooks.
Hopefully one of the parties fixes it soon.
Update:
The integration appears to have started working in the last couple of days. At least for us with PR create/update/comment?approve/merge.

Maybe Graham is talking about this here. You maybe need to change your IP-whitelist to connect to your server.
131.103.20.160/27 165.254.145.0/26 104.192.143.0/24.
I never used Posthooks. I m myself struggeling with the webhook configuration.

Not sure if this is related to your issue, but I'm putting it here as it might help others, there's currently an open issue related to non-standard ports that has similar symptoms:
https://bitbucket.org/site/master/issue/11514/webhook-fails-when-using-an-alternative

Do you have any IP limits on what IPs can post to that end target? The new web hooks may be using different IP addresses than the old services.

Related

Handling webhook calls in ASP.NET MVC application, implementation and testing

I have inherited this old ASP.Net MVC application and now I have to integrate a new Payment Service Provider. This PSP returns the responses to all payment requests via a POST message. The fields of the response are sent as hidden fields. The URL of the webhook must be provided in the request. After reading different SO posts along the same lines, I kinda know, in principle, what I would have to do. The PSP has a test & integration environment so I can send test request from my development environment. The problem I am facing is how to read the response. The URL for the webhook must be public, so me, running my development environment on my localhost, won't help. I can use webhook.site to get the responses, but I would like to get them in my application, so I check that my code behaves correctly and can handle properly the POST message containing all the hidden fields. Did anyone manage to find a possible solution for this problem?
TIA,
Ed
You mention that you want to test if you code behave correctly, I also see tag asp.net mvc in the post. For this requirement I can suggest you to go with azure. Azure have remote debugging feature which can easily help you test your code.
If you don't want to go with Azure, you can use ngrok software to make your localhost url public. This way you can trigger your code and debug it locally like remote debugging in azure.
There is one more way to test this thing very well. Just log the whole body of webhook (in logs or DB) and later execute it yourself through postman. This might doesn't let your webhook endpoint know the result at same time.

In AzureDevOps Server (on prem) how do I get the timestamp when I last looked at a Pull Request?

I'm using the Microsoft.VisualStudio.Services.Client library (added via NuGet) to connect to my on-prem Azure Dev Ops server and query various bits of information regarding pull requests. I'd like to make a little notification application that can alert me if someone has replied to a comment I made on a pull request. The trick is that I only want to see the notification if I haven't already looked at it.
I know that the system knows when I last looked at the pull request because it decorates pull requests with new content (comments, new code, etc.) with a little dot and when I open a pull request, it tells me that there are new comments since I visited last and tells me how long ago I looked at it.
How do I get access to the date that I opened the pull request in the web via the client libraries or REST? In other words, how would my app know that I have or haven't looked at new comments via the web page?
I did not find such an api that can retrieve the timestamp the last time you looked at the PR.
There is lastUpdatedDate you can use to track the comments that were checked. So as a workaround you can save the lastUpdatedDate to a file in your code, and compare this value everytime when you call api. Then you will get the latest updated comments.
However, PR comments notification can also be configured from azure devops. You can go to your user profile on the top right corner and select notifications to enable the notification for A comment is left on a pull request.
For more information about Azure devops notification, you can check this document.

IFTTT doesn't trigger on new row for Google Sheets service

I'm creating an Applet that will trigger as follows:
If New row added to, then Send an email from myemail#gmail.com
This is Applet version ID 100348625.
Notice the "to," which sounds to me like a bug. I've verified that everything is done properly and still this applet is never triggered. I'm adding rows to the spreadsheet and nothing happens. The applet says "Never run" so it doesn't even attempt to do it. It's like the adding of the row isn't being detected by IFTTT.
The spreadsheet contains an email address for the destination. The body of the email is long but within the maximum. I'm connected to my Google account for both the Google Sheet and Gmail services. My spreadsheet URL is good. I've tried both the internal URL and the Shared URL. I've also tried with the path and name instead of the URL but the same result.
What am I doing wrong?
I replicated your issue and I have managed to find a workaround, using Mail, instead of Gmail. When using the Gmail as that I got exactly the same result as yours - my applet was never triggered. Then I did it anew with Mail as that, and it started to trigger right away, sending me a bunch of notifications on each edit/row added. But the emails I receive are from "Google Sheets via IFTTT" which is action#ifttt.com instead of my own email.
Then I figured that something is probably wrong with the service and I headed to the services outage page of IFTTT which is located here. As of the time of this answer, one of the issues states:
Gmail actions may fail for some users Incident Report for IFTTT
Identified
The issue has been identified and a fix is being worked on.
It will require a large rework in how Gmail is implemented, we
appreciate your patience as we get Gmail up and running for everyone.
(Posted May 15, 2019 - 16:51 PDT)
This sounds to me like a serious issue, that is probably the explanation of all your trouble. It probably fails silently in the background and it the whole applet never registers as triggered.
Until they've fixed it, I suggest using Mail, instead of Gmail.
Here is how my working version looks:
Hope this helps!
In the end, I had to switch to another solution than IFTTT because this bug is not going to be fixed soon enough. Until it is fixed, I have no choice.
So I went with Integromat and I was able to do my integration work easily.

Why am I receiving a 500 status when trying to connect with ASANA api?

I am using this example: https://github.com/ajimix/asana-api-php-class/blob/master/examples/oauth.php to learn how to use the asana's oauth. I already registered my app on the asana's developers webpage. But, when I get the asana's response with my 'redirect_url'?code=0%XXXXXXX, localhost gives me a 500 status. I don't know why, does anyone know how I can solve it?
I tried using the other examples in there: https://github.com/ajimix/asana-api-php-class/blob/master/examples/, but I wasn't able to make them run either, I always get a 500 status. I think that the problem must be in my server, but I don't how solve it. Maybe changing something on the .htaccess file, but I don't really know what to put in there.
If you're looking to use the Asana API from PHP may I recommend the official first-party client: https://github.com/Asana/php-asana
It also contains examples of how to use with OAuth and is officially supported by us at Asana :-)

OAuth in Jira - 'consumer_key_unknown' while requesting token

I am trying to connect to Jira using OAuth. I have followed this manual and I have created app link in Jira instance and configured it with proper consumer key and public key. When I try to request a token using code from the example I am getting 401 with following message (same for python and perl instance):
oauth_problem=consumer_key_unknown
I am out of ideas what can be wrong. I will appreciate any tips.
Well, I believe that I have configured Application link in the wrong place. I have been somehow navigated to the link wiki/admin/listapplicationlinks.action. Then I accidentally found plugins/servlet/applinks/listApplicationLinks which looked pretty much the same as first but content was different. I have added link to the second location and everything works well now. Sorry for confusion.
I also had this similar error. So I then used different "consumer key"(tried to make this unique) other than the given one in the example manual. After searching a lot in internet about this error, I got to know that as most people are using that same consumer key(given in example manual), a database error occurred due to which this error was thrown.

Resources