Notifications related list in Incidents and Catalog tasks

Harry Campbell2
Mega Guru

Hi Everyone,

I'm hoping this is simple - I thought it would be simple anyway but couldn't figure it out.

I want to add a list of email notifications to incident and task records so there will be an easy way to see what emails were generated from each record. Rather than having it in the activity formatter.

Could anyone tell me the best way to achieve this?

Regards

Harry

1 ACCEPTED SOLUTION

I think you are not configuring the relationship correctly:



- Applies to table: it should be the table where you want to show the related list (e.g: incident).


- Queries from: the correct table is sys_email.



In the Query script, you have to use parent.number instead of current.number.



Another way to query is to use the instance field from the sys_email table:



(function refineQuery(current, parent) {


      current.addQuery('instance', parent.getValue('sys_id'));


      current.addQuery('type', 'IN', 'received,sent'); // If you want to filter send-ignored email, etc.


})(current, parent);



Hope it helps!


View solution in original post

9 REPLIES 9

Abhishek Raj3
Tera Guru

Hi Harry,



As per my   understanding, you can achieve this by using filter condition   on notification(incident or task table notification) .



Thanks,


Abhishek


Harry Campbell2
Mega Guru

Not sure I explained what I needed correctly.



When our resolver teams open an Incident, I want a related list on each incident that shows any emails sent as a result of that incident.



I have removed them from the activity formatter and want them in a related list.


Hi,



you can create a new relationship between task and sys_email_log table,and then add the relationship/related list on the form.


while creating relationship you can add the query like : parent.addQuery('subject','CONTAINS',current.number);



It will work if every notification will have task number in Subject. You can also add/modiy the Query according to your requirement.



Thanks,


Param


Harry Campbell2
Mega Guru

Thanks for your reply, I have tried this but the list just brings up all emails, the query doesn't seem to be working.



The subject line does include the number of the task but it's just not querying it.