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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Community Members
Community Events
Community Groups

Compare watchers against the initiator of an automation rule


I am trying to create a Smart Value with all the watchers to send an email but I want to make sure the initiator is not included. So I created a Smart Value where I use the following expression

{{#issue.watchers}} {{#if(initiator.displayName.eq(displayName),' ',{{emailAddress}})}}  {{/}} {{/}}

But the Smart Value comes back empty.

How can I check each item on an array and create another array only with the items that didn't matched the if condition?

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
Oct 23, 2020

Hi @Sujaira Moughawiche 

I believe that the #if syntax only works for numbers and not for strings.  And, I do not believe you can nest smart values with multiple curly-brackets.

Instead you can solve your problem using strings and the Join and Remove functions:

  • {{issue.watchers.emailAddress.join(";").remove(initiator.emailAddress)}}

How does this work...

  • {{issue.watchers.emailAddress.join(";")}} will concatenate the list, adding a semicolon separator
  • .remove() removes characters from a string.
  • In this case, we want to remove the initiator's email address:  .remove(initiator.emailAddress))
  • Note that if the initiator's email address is in the middle of the list, you could end up with an extra semicolon, such as: a;b;c;;e;


Best regards,


Hi @Bill Sheboy ,

Thanks so much for your help, this information was super helpful. I was able to remove the initiator by:

Adding a ; at the end of the join. 

Then proceed to remove the initiator including a ; at the end as well.

But I still have one ; at the end of the string and I haven't been able to remove that ;, I can't leave it because it's causing an error when sending the email. 

Smart value watchers:


Is there a way to do this, I tried to save the length of this smart value in another and the use the left function to return the string minus the last character but it's not working.

Smart value watcherslen:

{{#=}} {{watchers.length()}} - 1{{/}}

 Smart value emails:


But the emails returns blank. Any ideas on how to remove the last character of a string?  

@Bill Sheboy  Never mind I figured it out. Thanks. 

Like Bill Sheboy likes this
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!
Apr 28, 2023

I couldn't get this to work with the join operation, but using the below format worked for me!



Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events