Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,063
Community Members
 
Community Events
168
Community Groups

Trello Butler - Negative rules in trigger

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 Feb 09, 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 

Worked wonders. Thanks @Iain Dooley

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events