I want to have the details in one section in email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 04:49 AM
Hi All ,
I have an existing functionality where I have two sections in my email notification as seen in the image below
now I want to edit the section and I want to have all the ten fields one above the other
I have this piece of code in my existing script include :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 04:56 AM
@Pooja Khatri , Update this logic
if(task_class_name == 'change_request') {
this.content = {
[
{field: "Short Description", value: task.short_description.getDisplayValue()},
{field: "Change Coordinator", value: task.requested_by.getDisplayValue()},
{field: "Change Type", value: task.type.getDisplayValue()},
{field: "Configuration Item", value: task.cmdb_ci.getDisplayValue()},
{field: "Category", value: task.u_category.getDisplayValue()},
{field: "Hosting Impact", value: (task.u_hosting_impact) ? "true" : "false"},
{field: "Probability", value: task.u_probability.getDisplayValue()},
{field: "Risk", value: task.risk.getDisplayValue()},
{field: "Impact", value: task.impact.getDisplayValue()},
{field: "TWM", value: (task.u_third_weekend_maintenance) ? "true" : "false"},
{field: "Planned start date", value: (task.start_date.nil()) ? "" : this.getEST(task.start_date)},
{field: "Planned end date", value: (task.end_date.nil()) ? "" : this.getEST(task.end_date)}
],
};
}
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 04:59 AM
Hi @shyamkumar VK - I have already tried with this logic but at the start of [ bracket it is giving me an error of Parsing error : Unexpected token , can you please help me how can I fix this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 05:02 AM
@Pooja Khatri , can you try with this logic
if (task_class_name === 'change_request') {
this.content = [
{ field: "Short Description", value: task.short_description.getDisplayValue() },
{ field: "Change Coordinator", value: task.requested_by.getDisplayValue() },
{ field: "Change Type", value: task.type.getDisplayValue() },
{ field: "Configuration Item", value: task.cmdb_ci.getDisplayValue() },
{ field: "Category", value: task.u_category.getDisplayValue() },
{ field: "Hosting Impact", value: (task.u_hosting_impact) ? "true" : "false" },
{ field: "Probability", value: task.u_probability.getDisplayValue() },
{ field: "Risk", value: task.risk.getDisplayValue() },
{ field: "Impact", value: task.impact.getDisplayValue() },
{ field: "TWM", value: (task.u_third_weekend_maintenance) ? "true" : "false" },
{ field: "Planned start date", value: (task.start_date.nil()) ? "" : this.getEST(task.start_date) },
{ field: "Planned end date", value: (task.end_date.nil()) ? "" : this.getEST(task.end_date) }
];
}
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 05:08 AM
@shyamkumar VK - I tried it with the below script , it has now stopped pasting the entire details in the email notification