- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2021 10:53 AM
We have workaround field (Column name : u_srt_workaround) with Type : True/False in the Incident form and the same i am using it in the Email template to display the value (${incident_alert.source_incident.u_srt_workaround}) for major incident module .But the requirement is like whenever "True" has been selected in the workaround it has to display the Value as "Yes" instead of True in the Notification. And if "False" is selected in the Notification it has to display value as "No" in the notification instead of false. Could you help me to achieve this.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 01:59 PM
Hi,
Try changing your mail script to:
if (current.getTableName() == 'incident_alert_task') {
if (current.source_incident.u_workaround) {
template.print("Yes");
} else {
template.print("No");
}
} else if (current.getTableName() != 'incident_alert_task' && current.u_workaround) {
template.print("Yes");
} else {
template.print("No");
}
}
You can try that. The main point here is that you may not be using this on the incident table that can see the workaround field you have...so you need to establish where you are as far as what table this mail script is ran on and then use the appropriate dot-walking to get you there.
Please use the above as an example.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2021 10:56 AM
Hi,
You'd want to use a mail script to do this. You have access to the current object and can do a simple conversion there (so if (current.field_name) { etc. then result in:
template.print("Yes");
and then within your notification you can just call the mail script like (EXAMPLE😞
Selection was: ${mail_script:name_of_mail_script}
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2021 05:43 AM
Hello,
As I've mentioned before. Please read my post and attempt this yourself. If you have any questions, please let me know.
Please check spelling on your field name(s), etc. such as in your mail script:
if (current.u_field_name) {
template.print("Yes");
} else {
template.print("No");
}
Where you'd change u_field_name to the actual name of your field.
Please mark above reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2021 06:22 AM
Hello,
As I've mentioned before. Please read my post and attempt this yourself. If you have any questions, please let me know.
Please check spelling on your field name(s), etc. such as in your mail script:
if (current.u_field_name) {
template.print("Yes");
} else {
template.print("No");
}
Where you'd change u_field_name to the actual name of your field.
Please mark above reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2021 12:06 PM
Hi,
Sorry, I'm not sure why you're only responding to the other posters, when I've given directions above, haha, that others are saying the exactly the same thing I did.
So you need to verify your field name as appropriate, in your script in your screenshot you have:
if (current.u_workaround == true) {
so is your field name really "u_workaround"...in your original post you had:
u_srt_workaround
So should it really be?
if (current.u_srt_workaround == true) {
Please check you field spellings and correct, else it'll continue to result to 'No'.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!