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

Need a better explanation of {?} vs {*} vs {* }

Erica Peers
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!
April 22, 2024

The docs about wildcards don't explain the difference between these wildcards very well in my opinion.

  • {*}: this wildcard will match any text with blank spaces. Typically, it is used to match the text at the end of a card name or description.
  • {* }: this wildcard will match a text until a blank space or the end of the text. Typically, it is used to match the text at the beginning/in the middle of a card name or description. When using this wildcard, make sure that you include a blank space in between the asterisk and the closing bracket.
  • {?}: this wildcard will match the minimum amount of text.

What does "minimum amount of text" mean? For years my best guess was that the difference between {?} and {*} is that {?} doesn't match spaces, but I found that to not be true today. I have a Butler rule like this:

when a card with a name starting with "{?}-{?} {* }" is added to the board, set start date now and add link "https://blahblahblah.atlassian.net/browse/{wildcard1}-{wildcard2 }"

I would add a card with a title like "ABC-123 This is the Jira issue name" and it would add a link to https://blahblahblah.atlassian.net/browse/ABC-123, which is what I was aiming for. Today I created a card but forgot to add the ABC-123 before the Jira issue name, and the issue name happened to have a dash in it (let's say it was "Ticket name - testing 123"), so the link it added was something like https://blahblahblah.atlassian.net/browse/Ticket name-. So the first wildcard it found was "Ticket name", which has a space in it even though the wildcard is {?}, not {*}.

As a test, I created a card with the name "this is a - 232 test * 94823" which ended up adding a link to https://blahblahblah.atlassian.net/browse/this is a-

Then I changed the butler rule to look for a card with a name starting with "{*}-{*} {* }" and  created a card with the same name, and the link that got added to that one was https://blahblahblah.atlassian.net/browse/this is a-232 test *

So yeah... can anyone explain how {?} actually works?

1 answer

0 votes
Vongsawat
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.
April 28, 2024

(preface that this is my own jank understanding through using Trello over the years)

My understanding is that, if there are multiple ways that a string would satisfy the pattern, {?} will always go for the version where it is shortest. Whereas {*} will go for the longest. Resolving from first to last.

Hence if the string is Mon-Tue-Wed
{*}-{*} will give "Mon-Tue" and "Wed"
{?}-{*} will give "Mon" and "Tue-Wed"

If there is only one way to satisfy the pattern, then they operate identically. so {*}-{*}-{*} and {?}-{?}-{?} would output the same, provided the string has 2 dashes.

----

I am less sure about {* }.. My understanding was that if there were multiple ways to resolve, it would always prefer to cut off at the first space. But after some testing, I find myself completely bamboozled, with certain strings matching {*}-{*} but not {* }-{*} depending on where I add spaces... so I threw up my hands ha

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events