Trello Butler - Negative rules in trigger

Korppu
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 9, 2021

Hi community,

 

I am trying to replace spelling mistakes on our boards with correct words to avoid errors later.

I am however having issues with negative rules in my trigger. Butler seems not to take these into account.

In short my issue is that I want to replace "BC" in description in cases where the description does not contain "ABC" or "BBC". However my trigger still fires regardless if my description contains ABC or BBC replacing the content.

Currently my rule looks like this:

when the description of a card with a description not containing "ABC" with a description not containing "BBC" contains "BC", set the card's description to "{textbeforematch}CB{textaftermatch}"

 

Could you help me out here?

1 answer

1 accepted

1 vote
Answer accepted
Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2021

@Korppu the best way to do this is using a regex with a negative look behind:

when the description of a card contains "regex:/(?<![AB])BC/", set the card's description to "{textbeforematch}CB{textaftermatch}"

I tested this out, when I set the description to ABC or BBC it doesn't change, but when I set the description to KBC it changes it to KCB 

Korppu
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 9, 2021

Worked wonders. Thanks @Iain Dooley

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events