The CreatorCon Call for Content is officially open! Get started here.

Adding links from 2 different tables into an email notification

slalbiharie
Kilo Explorer

I have a change workflow. It is triggered for Routine and Emergency.
Within this workflow I have this condition: If Routine fire this notification, if not fire this one. That workds great
Within these notifications - that are both within the workflow itself, I need to be able to add a link to the Change as well as the Change Task. I have no problems for the change but I am not able to add the link to the change task itself.

Because this is based off of the change request table, can this even be done?

8 REPLIES 8

JenniferS1
Kilo Contributor

I have something similar that I need to do. I have a project task email notification. I would like to add a link to the parent project. I have used the example provided earlier and tweaked it as followed:


projectLinks();
function projectLinks() {
//Check for parent project and add link
var gr = new GlideRecord('pm_project');
gr.addQuery('pm_project_task', current.sys_id);
gr.query();
if(gr.hasNext()){
template.print('Project: \n');
while (gr.next()) {
var link = createLinkForProject(gr.getTableName(), gr.sys_id, gr.number);
template.print(link + '\n');
}
template.print('


');
}
}

function createLinkForProject(strTableName, strSysID, strProjectNumber) {
return "" + strProjectNumber + "";
}


This does provide the link to projects but it shows all of the projects, not just the parent project for the task. Does anyone have an idea how to fix this?

Thank you!


To provide a link to the parent project from a project task notification, you should be able to remove all of the mail scripts and just put the following within the notification itself:



Click here to view Project: ${parent.URI_REF}


Hi Brad,

 

I need to get Problem record link on related incident email.

I tried below code but it didn't work.

${problem_id.URI_REF}

 

Can you help if I am missing something?

JenniferS1
Kilo Contributor

Worked perfectly! Thank you!