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

Mail script to send a link to a list of tickets

Dubz
Mega Sage

Hi All,

 

I have a scheduled job checking my incident table for tickets that have been in progress for longer than 4 days, i'm passing an array of the resulting sys_id's through to a notification as parm2 and then looping through them to populate the notification with a series of links to each incident. 

 

The trouble is, if there are a lot of records, the notification gets a bit long. A better solution would be to send out a link to a list of tickets so that recipients can just click on that and view the subset. 

 

Is it possible to dynamically build a link to a list using something like an encoded query string? If so, how do you do it?!

 

Cheers

Dave

1 ACCEPTED SOLUTION

Gurpreet07
Mega Sage

yes that is possible.

var ids = 'sys_id1,sys_id2_sys_id3,sys_id4' ;     //comma separated list of sys_ids (String)

var link = '<a href="incident_list.do?sysparm_query=sys_idIN'+ids+'" >Incident List</a>';

template.print(link);

View solution in original post

5 REPLIES 5

Hi @rammohanraomadd 

what if we want to add dynamic values to encoded query.

How to do that?