Attachment link/URL in worknotes .

Deepak92
Tera Contributor

Hi Team,

How can i achieve the below requirement.

When the agent attaches the attachment to ServiceNow, a link to the attachment should get added to work notes.

 Any help would be highly appreciated .

 

Thanks in Advance.

Regards

Deepak Bisht

1 ACCEPTED SOLUTION

Hi,

then use this but it won't be clickable link unless you give anchor tag

I have not used anchor tag in below code

var rec = new GlideRecord(current.table_name);
rec.get(current.table_sys_id);

var url = 'https://' + gs.getProperty('instance_name') + '.service-now.com/sys_attachment.do?sys_id=' + rec.sys_id;

rec.work_notes = url;

rec.update():

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

Hi Ankur,

Once again thanks.

i have sorted out the problem of redirecting, now its not redirecting to homepage.

++ to point its coming like incident no. link kind off . i need kind of Metadata format.(https://dev****************/*****)

find_real_file.png

 

How can i make it?

any input or suggestion

Regards

Deepak Bisht

Hi,

please share what have you written in script and what should be the output

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

Below is the script which i have written .

find_real_file.png

output is whenever i am attaching attachment its coming like as link as incident no.

 

find_real_file.png

Expectation is : it should  come in metadata form like below

find_real_file.png

Regards

Deepak

Hi,

then use this but it won't be clickable link unless you give anchor tag

I have not used anchor tag in below code

var rec = new GlideRecord(current.table_name);
rec.get(current.table_sys_id);

var url = 'https://' + gs.getProperty('instance_name') + '.service-now.com/sys_attachment.do?sys_id=' + rec.sys_id;

rec.work_notes = url;

rec.update():

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Deepak - You may find below thread helpful.

https://community.servicenow.com/community?id=community_question&sys_id=b06d7cfadb952b804abd5583ca96...

 

- Pradeep Sharma