Regex is throwing off wildcard count

Sarrah Saunders July 30, 2023

I have two boards and a card on each board. The cards are linked together. When a certain custom field updates on one, I want it to update on the other. I can do this, but I only want it to work for certain cards -- cards with either the purpose "Employee Purchase", "Design Project", or "Neylan Workroom". 

I have a rule: When custom field "Misc." is set to {*} in card with custom field "Purpose" set to regex:/.*(Employee Purchase|Design Project|Neylan Workroom).*/ find the first card linked in the attachments set custom field to "Misc." to {wildcard 1}. 

However, instead of the Misc. text transferring, it sets the custom field "Misc." to "Employee Purchase"

2 answers

1 vote
Dreamsuite Mike
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 1, 2023

Whoa there @Sal There are people here who can help 😄😄😄

 

Hi @Sarrah Saunders 

It can be a little confusing how regex is implemented in Trello and @Sal is right about there being limited information out there anywhere.  Luckily there are megageeks  like @Brittany Joiner and I who spend our lives playing with Trello and pushing the limits of what can be done.🤓🤖

 

Regex is an area I've been playing with a lot in the past year and there are so many cool things that can be done.

I have come across the issue you mention about allocation of capture groups to wildcards. 

 

Firsltly, you can help reduce the wildcard confusion by changing your trigger from:

When custom field "Misc." is set to {*}

to

When custom field "Misc." is set

 

When I am developing automations with Regex,I put this step in to each automation to help with debug, maybe this can help you.

 

and post comment, "Match: {matchedtext}\n Wildcard1: {wildcard1}\n Wildcard2: {wildcard2}\n Wildcard3: {wildcard3}\n Wildcard4: {wildcard4}......."

Then when you test the automation, you'll see a comment showing the entire regex match as well as the capture groups you have set up.

Once the automation is tested and works, you can remove that step from the command

 

I hope this helps...

Sal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2023

I'm happy to know you and @Brittany Joiner are super experts on regex :D. I personally don't know much about regex, and that's the reason I thought the developer community could help. Well, I'll leave it in your hands then, @Dreamsuite Mike <3. Thanks for the help! 

Like Dreamsuite Mike likes this
0 votes
Sal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 31, 2023

Hey @Sarrah Saunders! Sadly, we're pretty limited in how we support regex issues and questions in our community. In your case, I recommend you create a new post in our Developer Community for Trello, and someone from our developers or another developer from the community might be able to help you with your question. I hope that helps! 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events