Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Check if {{pullrequest.destinationbranch.url}} contains a string

Ferran Salcedo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2022

I want to create an automation that moves issues depending on the destination branch in Github. Is there a way to use a regex to check if the returned url contains a specific text and then build my if cases based on that?

Something like:

if {{pullrequest.destinationbranch.url}}.contains("text"), then do something.

Using a normal hook I use:

key in ({{webhookData.pull_request.head.ref.match("([PIPD]+-\d+)")}})

I'm looking for the same but using the Pull Request trigger instead of the webhookData

2 answers

0 votes
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.
February 7, 2022

Hi @Ferran Salcedo -- Welcome to the Atlassian Community!

Yes, you can do that.

Please take a look at the match() and other text parsing functions to see what helps: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/

Of note: I have found the regular expression parsing in automation rules may not support everything in your favorite flavor of RegEx so some experimentation may be needed.

Kind regards,
Bill

0 votes
Ferran Salcedo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2022

.

Suggest an answer

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

Atlassian Community Events