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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,673
Community Members
 
Community Events
176
Community Groups

Can I create a bot that will trigger some external event if a word is mentioned in a comment?

I want to be able to monitor in Pull Requests if a particular word or phrase is mentioned in the comment section.

 

So the flow would go like;

1. create PR

2. mention phrase in comment for example "trigger xyz"

3. Request made to external service with body of xyz

 

Thanks!

2 answers

1 accepted

2 votes
Answer accepted
Mikael Sandberg Community Leader Mar 23, 2022

Hi @Kevin Gilmore,

Welcome to Atlassian Community!

You could do this by using a webhook that triggers when a comment is created in a PR. Have a look at Manage webhooks for more information.

Oh, wow, I didn't know about this. It looks easier than the approach I suggested. 

But, can you check for the keyword "trigger" and parse out "xyz" with this approach? (Maybe Kevin can handle this on the external service's side, if it cannot be done on the Bitbucket side...)

Mikael Sandberg Community Leader Mar 24, 2022

The webhook will only trigger based on the event, you would still have to configure your external script to parse the comment for what you are looking for.

This is just what I was looking for. Thanks

0 votes

I don't think you can do this in the Bitbucket side, but if your pull requests are normally related to Jira issues, then you can definitely create an automation rule on the Jira side!

For exampe, you can create a rule with the trigger Issue commented, then check the comment text for the keyword "trigger" using the Advance Compare Condition, finally send the request to the external system using the Webhook action. It'd definitely work.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events