copy attachment from change request table to change task table

Community Alums
Not applicable

Hi all,

 

I have created the below after insert and update business rule but it's not working

can anyone help me on this

Pavithra813_0-1703762811601.png

Thanks

4 REPLIES 4

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Community Alums ,

 

the last log which you have printed is missing an 's' It should be copiedAttachments. Plus if you are looking for the BR to run when any attachments are added to Change request then the current approach is wrong. You need to have a BR created on attachment table which should be after insert & it should trigger only when table name field is change_request. Then u need to write a logic over there to copy attachments from change to change task

 

Thanks,

Danish

 

SunilKumar_P
Giga Sage

Hi @Community Alums, You need to insert the change_request inside quotes. Can you try changing the line 7 as below?

 

var chg_req = current.getValue('change_request');

 

Regards,

Sunil

 

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Have you considered more modern way of working: Flow Designer. And with Flow Designer, you have a zero code option available to copy attachments.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

your line 7 should have change_request field name in quotes -> 'change_request'

Also why to copy the same file on CHG Task. Instead have a look on this and you can show attached related list on CHG Task form

TNT: "Related Attachments" Related List 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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