applying a condition to a field in an email subject

scottjus82
Kilo Guru

Hi,

 

I am setting up a Calendar invite for change requests and an issue (amongst others) I have is adding a field to the email template subject if its populated with yes? the field asking if there is an outage and its a drop down with a Yes/No option. I want to add this field to the subject if there will be an outage so when its added to a calendar its clear that this change includes an outage. At the moment I am calling the field with the line "is there an outage" which then adds yes or no. What I really want is the word outage to show if there is one and nothing to show if there isnt.

 

Any thoughts?

 

Regards

1 ACCEPTED SOLUTION

I'm guessing that they don't work from meeting invites. In that case you'll probably need to go with 2 different notifications where one has your outage subject and the other does not, then use the notification conditions to determine which should fire.


View solution in original post

8 REPLIES 8

Hi Steve,



Let's take out the if statement to check and see if the email.setSubject() is working at all. If it still doesn't work, try changing the type from a calendar invite to a regular email (I know that's not a solution, just a troubleshooting method). I seem to remember something about there being trouble with mail scripts on calendar invites.



The other way to do this instead of mail scripts would be to have 2 different notifications with different conditions and subjects.


Hi Steve.



Thanks for the troubleshooting. so below is the outcome



Removing the if statement as an invitation does not change the subject


Keeping the if statement but changing to an email notification does not


change the subject


Removing the if statement and changing to an email notification DOES change


the subject



So am I right in thinking I have two issues, my if statement is not working


and, as you pointed out, there is a problem with mail scripts in meeting


invites?




On 13 August 2014 14:43, Brad Tilton <community-no-reply@servicenow.com>


I'm guessing that they don't work from meeting invites. In that case you'll probably need to go with 2 different notifications where one has your outage subject and the other does not, then use the notification conditions to determine which should fire.


Hey Brad,



If I had thought of it properly before I would have abdnoned the script idea and gone with two notifications as its a much simpler way of doing it!



Thanks for you help, this is now working as expected. Are only issue is getting the link to display as it does on a change notification (as in click here to view the change instead of displaying as a URL but from our testing earlier I think thats a limitation with calender invites.



Thanks again!