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

How do I implement regex in automations?

Melanie Fallow
Contributor
March 6, 2024

Hi! I just found out that Trello automations can use regex, which is going to open up a whole new realm of possibilities for me!

All of my card names contain a six-digit number. I can get the trigger to fire when I add a card that contains the number with this sort of thing:

regex:/\d{6}/

But I can't figure out how to get the actions to recall that number and do things with it. For example, I'd love to do something like,

When a card with a name containing "regex:/\d{6}/" is added to the board, set custom field Job Code to [the number]

The number bit is the part I can't figure out how to do. Is there a way to use wildcards without specifying surrounding text? Could I set that number string as a wildcard somehow? I just want it to pick out the 6-digit number and do operations with that data. Thank you!

1 answer

0 votes
Hannah Humbert - Simpla Workflows
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 6, 2024

@Melanie Fallow for this specific use case, using wildcards might be better suited. This would only work if your card titles followed a set pattern (e.g. Job Code: 1234 - card name).

When a card with a name containing "Job Code: {*}" is added to the board, set custom field Job Code to {wildcard1}


Hope that helps!

 

Melanie Fallow
Contributor
March 6, 2024

Thanks for the answer! I have 2 boards I’m currently working with. One has cards with a formal naming convention, where I could use this. But the other doesn’t—I’m trying to get it to pick out the code from wherever it is in the name.

Hannah Humbert - Simpla Workflows
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2024

Ah, sorry just re-reading your original message. I'm not sure if it's possible with regex 🤔 do the cards follow any sort of pattern at all? For example, the number is always at the beginning of the title, or at the end? Or is it just random? If the number is always at the beginning of the title, you could do:

When a card with a name containing {* } is added to the board, set custom field Job Code to {wildcard1}

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events