Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 02:43 AM
Hi
I have a requirement to print description when the it is not empty.
i have written the script ,but it is getting also when the description is empty.
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var descriptioncheck = current.description;
gs.log("TestCheck"+descriptioncheck);
template.print("<div>Short Description: ${short_description}</div><div style='height:30px;'></div><div>Assignment group: ${assignment_group}</div><div>Assigned to: ${assigned_to}</div><div>Due date: ${due_date}</div><div>Click here to view Task: ${URI_REF}</div><br/><hr></div>");
if(descriptioncheck !== "")
{
template.print("<br/><div>Description: ${description}</div>");
}
})(current, template, email, email_action, event);
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 02:45 AM
Hi @avinashdube ,
Update the if condition and use only “!=“ , test the result.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 02:45 AM
Hi @avinashdube ,
Update the if condition and use only “!=“ , test the result.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 02:55 AM
Hi,
Can you try below code.
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var descriptioncheck = current.description;
gs.log("TestCheck"+descriptioncheck);
if(descriptioncheck !== "")
{
template.print("<div>Short Description: ${short_description}</div><div style='height:30px;'></div><div>Assignment group: ${assignment_group}</div><div>Assigned to: ${assigned_to}</div><div>Due date: ${due_date}</div><div>Click here to view Task: ${URI_REF}</div><br/><hr></div>");
template.print("<br/><div>Description: ${description}</div>");
}
})(current, template, email, email_action, event);

