You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过PR评论结合Post Webhooks for Bitbucket触发Jenkins多分支任务

How to Trigger Tasks on Specific Pull Request Comments with Post Webhooks for Bitbucket

Got it, let's walk through exactly how to set this up so your task runs only when someone comments "run this again" on a Bitbucket PR using the Post Webhooks for Bitbucket plugin.

Step 1: Enable the Comment Event

First, confirm you’ve toggled on the Pull request commented option in your webhook configuration (you mentioned you spotted this, so just make sure it’s enabled alongside your existing "created" and "re-scoped" events).

Step 2: Add a Payload Filter for Target Comment Text

The magic here is filtering the webhook to only fire when the comment matches your exact phrase. Most versions of this plugin include a Payload Filters or Conditions section where you can define rules based on Bitbucket’s webhook JSON payload.

Here’s the exact filter setup you need:

  • In your webhook settings, find the "Payload Filters" section and add a new rule.
  • Set these values:
    • Path: comment.content.raw (this targets the unformatted raw text of the PR comment in Bitbucket’s payload)
    • Operator: Contains (use Equals if you want an exact, case-sensitive match; "Contains" works for slight variations like extra spaces)
    • Value: run this again (your target comment trigger phrase)

Step 3: Verify the Payload Path (Optional)

If you’re unsure about the payload path, you can capture a test payload using a webhook testing tool or by checking your task runner’s logs. Look for the comment object in the JSON response—you’ll see the raw comment text under content.raw.

Step 4: Test the Setup

Create a test PR, leave a comment with "run this again", and check if your task triggers. If it doesn’t, double-check:

  • The filter path is spelled correctly (case sensitivity might matter depending on your plugin settings)
  • The "Pull request commented" event is still enabled
  • Your task runner is properly listening for the webhook signal

Example Rule (Visual Builder Version)

If your plugin uses a drag-and-drop rule builder, it might look like this:

IF comment.content.raw CONTAINS run this again THEN trigger webhook

That’s all you need! This setup ensures the webhook only sends a trigger when your specific comment phrase is used, rather than firing on every PR comment.

内容的提问来源于stack exchange,提问作者felixliljb

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 09:17:42