How to convert True/False value into Yes/No to display in the Notification

Vamshi1
Tera Contributor

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.

1 ACCEPTED SOLUTION

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!

View solution in original post

16 REPLIES 16

Hello Allen,

Thanks for your inputs. But it looks I am missing something here.I have created a Workaround field in my personal instance (screenshot attached) and created the attached email script.still it is returning the 'No' value in the Notification for workaround = true records as well.Could you please guide me. 

Hi,

Please show what the name of this field is? As I've mentioned above, you said in your original post the name of this field was: u_srt_workaround

What is the real name of this field?

Use that instead of u_workaround.

Check spelling, etc.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hello Allen,

Please find the attached for the dictionary entry of the field.

Thanks for that!

And is this notification that you're running the mail script on, the Incident table?

Please check your notification setting to ensure it's running on the Incident table.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hello Allen,

It is an Email client template and it is working on Table : Incident Communication Task(incident_alert_task).And the same we are using in the major incident management communication tasks.Is there anyway to achieve it without changing the table.