Condition on custom email not working with underscore

I am trying to send an email based on the issue type.  My issue types are  EBS_ALERT and EBS_Request

This is what I am using - 

['EBS_ALERT', 'EBS_Request'].contains(issue.issueType?.name)

and when I test with either issue type I can not get it to evaluate to True.

If I use this it will evaluate to true.

['Bug', 'Story'].contains(issue.issueType?.name)

 

Is it something with the underscores?

1 answer

1 accepted

2 votes

Can you change it to:

assert ['EBS_ALERT', 'EBS_Request'].contains(issue.issueType?.name)

And preview with one of those issue types. This should produce an exception which will give enough information to work out what it thinks the issue's name is.

If it's not clear from that post back here with the top part of the exception.

 

Here is what I got - If I am reading it correct it is seeing that issue name.  

We are currently using issue.issueType.name == 'EBS_ ALERT' in a condition and that works.

assert ['EBS_ALERT', 'EBS_Request'].contains(issue.issueType?.name) | | | | false | | EBS_ Request | IssueConstantImpl[[GenericEntity:IssueType][sequence,null][name,EBS_ Request][iconurl,/secure/viewavatar?size=xsmall&avatarId=10320&avatarType=issuetype][description,create a request in the EBS queue - non emergency][style,null][id,10103][avatar,10320]] RS-10957



EBS_ Request

There seems to be a space after the underscore.

 

UGH!  Sorry, your eyes are better than mine!  I was copying as the client sent it to me and even looked for a space at the end.

 

Thank you!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

166 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you