Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I tell the difference between a pull request comment created and updated?

Hi all.

In the documentation it says "with an event key of pullrequest:comment_updated" and "with an event key of pullrequest:comment_created".

But I can't actually see the difference between the 2 in the received events other than comparing updated_on to created_on. Which isn't waterproof either because on a new comment the updated_on and created_on aren't identical either.

 

Is there anyone that can nudge me in the right direction?

1 answer

1 accepted

1 vote
Answer accepted

Hi Richard,

The payload you receive should contain headers about the event.

The header x-event-key is set to pullrequest:comment_created when a PR comment is created and pullrequest:comment_updated when a PR comment is updated.

You can check all headers and the body of a request on Bitbucket site as well if that'll help you see what I'm talking about.

If you go to Bitbucket Repository Settings > Webhooks > then select View requests for your webhook and then select Enable History. Next time that there is an event, you can see it listed there and select View details for the event.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Hi Theodora,

Thank you for your reply. It seems I have been blind and didn't think it through that the body and headers are 2 seperate things. I have some trouble getting the headers with PHP, but I'll have to figure that out myself.

Thanks for your clarification on the issue!

You're welcome Richard, glad to have helped!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,811 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you