fixed

Changes to working with Tags in Automation Rules

📘

The fixes will be rolled out to all public clouds in the beginning of April, 2020

We have fixed a couple of very annoying bugs concerning Tags in Automation Rules, which means that the way of working with Tags is changed to be more logical and consistent.

Using Previous and Current Tags in Filters

Let's take a look at the following Automation Rule

812

Basically what we're trying to achieve with this rule, is to do an action when a Tag use is added to some Request. For a start we'll be testing it with a Request that already has one tag: merged. To trigger the rule, we'll add one more Tag to it: use.

495

Before the fix: the action is performed
After the fix: the action is performed

Now we'll take the same Request that already has two tag: merged and use. We'll remove the Tag use.

564

Before the fix: the action is performed. This was NOT correct behavior.
After the fix: the action is NOT performed

And the last test will with a Request that does not yet have Tags in it. To trigger the rule, we'll add one more Tag to it: useless.

488

Before the fix: the action is performed. This was NOT correct behavior.
After the fix: the action is NOT performed

🚧

What if you actually wanted to filter by a part of a Tag?

If you'd like to conserve the old behavior, please use the following Javascript filter instead of UI filter: return args.Current.Tags.includes("hotfix");
Here hotfix will be a part of a Tag you're looking for, so all the Tags like hotfix 2.0 will match this filter.

Using Previous and Current Tags in Actions

Let's take a look at the following Automation Rule

807

We'll be testing it with a Request that already has one tag: merged.
To trigger the rule, we'll add one more Tag to it: useless.

555

Before the fix:
In args.Previous.Tags we have nothing. This field is empty.
In args.Current .Tags we have a combination of Previous and Current Tags: "merged ,merged ,useless".
The tags are joined with a space and a comma.

After the fix:
In args.Previous.Tags we have only Previous Tags: "merged"
In args.Current .Tags we have only Current Tags: "merged, useless".
The tags are joined with a comma and a space.