Bitbucket "State" Criteria to exclude Pull Requests that are in the new DRAFT status from Automation

Steve Holland
Contributor
January 28, 2025

We have DEVOPS triggers from BitBucket that get kicked off when Pull Requests are open; ie: "Send an email to this channel when a Pull Request is opened" or "add a comment to this JIRA when a pull request is opened" 

Before Atlassian introduced "DRAFT" pull request state; we would simply put "WIP" in our pull request titles and we excluded the presence of this text from triggering our automations.  Now; instead of using WIP in the title, we put the PR's into DRAFT status;....

How can we write the automation to still send a message when Pull Requests are open, but only when they are not in the draft state?  bbprdraft.pngjiraprautomation.png

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

Hi @Steve Holland 

There is a state attribute for that trigger, {{pullRequest.state}} 

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/#--Pull-request--

However, I recall from some other posts and suggestions it does not capture "draft".  I recommend first experimenting by writing that smart value to the audit log to check if the draft ones show up as such.

Kind regards,
Bill

Steve Holland
Contributor
January 28, 2025

i''ll give that a try and report back if i have any success.  thanks as always @Bill Sheboy 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events