Butler rule help
Asked by Jan:

On every card we use a code that starts with alpha and ends with numeric then there is a name given in alpha. I have a butler rule that needs to create another card if there is an alpha trigger as part of the code.

So i.e. if PR is part of the code the bot should create the new card

My issue is the bot is picking up what is in the name as well as what is in the code.

Is there a shortcut that I should use to only pick up the alpha prior to the numeric so it will ignore the name?

Thanks in advance


Answers:
author: Hannah Humbert - Simpla Workflows
body: [@Jan](/t5/user/viewprofilepage/user-id/4057508) Just to clarify, would this be accurate?  

Card 1: "AB123 Task"  
Card 2: "12345 Task"  

Because card 1 begins with the alphabetical character "A", then the automation should trigger. However, it should NOT trigger for card 2 because it begins with the numerical character "1".  

You can use regex to accomplish this. Try:

```
when the name of a card starts with "regex:/^[A-Za-z]/"
```

This will match any single upper or lower case alphabetical character.

comments: author: Jan
body: Apologies only just saw your response

Code is normally abcbl123 task

the bl can also be pr or up to seven different letters to indicate the task type

but then the task can be any description that can but not often hold the task type letters if that makes sense

Hence I was hoping that the rule can only refer to the alpha prior to the numerics


author: Hannah Humbert - Simpla Workflows
body: [@Jan](/t5/user/viewprofilepage/user-id/4057508) Thanks for the extra info! So just to clarify, you'd like the rule to say something like:  

"when the name of a card contains "pr", or "bl", or "xx" ...... etc. "   

Is that right?


author: Jan
body: Yes but only if in the code so

abc'**bl**'123 - black

So I need the rule to pick up the BL prior to the numerics not the bl in the name


author: Hannah Humbert - Simpla Workflows
body: Ok got it, thanks for clarifying. Sounds like wildcards would be best here. Try the below:

```
when the name of a card starts with "{* }bl{* }"
```

Your rule would trigger if the card name was: "abcbl123 - xxx"  
Your rule would NOT trigger if the card name was "abcgg123 - xxblxx"  

Note the space after the asterisk. More details here: <https://support.atlassian.com/trello/docs/pattern-matching-and-wildcards/>


author: Jan
body: Thanks so much I will change my existing rule


author: Vongsawat
body: Not quite sure what the code looks like, could you type up examples? In my head I see Alpha234PR? The formatting matters. And examples of which ones you want to be picked up by the automation.  

The basic way is that the trigger can have filters that check if the card titles starts with, ends with, contains - a piece of text.  

Or more advanced is to play around with [Wildcards](https://support.atlassian.com/trello/docs/pattern-matching-and-wildcards/), that are much more specific and powerful, but which can be tricky to get right depending on the format.

comments: author: Vongsawat
body: Based on your other reply... A Wildcards solution would probably be a bit difficult, as there's nothing constant in the format that could be referenced.

"aaapr111 \| task" could be filtered for names that start with "{\*}pr{\*} \|" for instance, which would only look for pr that occurs before the special character "\|" (which you prohibit use in task names).

I don't really play around with regex, but hopefully you get a better answer with that


author: Jan
body: Thanks, gives me something to look into


Tags: cloud

trello-cloud