Can we copy the articles from one knowledge base to another knowledge base ? If yes, How ?

Ramesh S Reddy
Tera Contributor
 
2 REPLIES 2

Danish Bhairag2
Tera Sage

Hi @Ramesh S Reddy ,

 

Yes we can achieve the following using GlideSysAttachment.copy command.

 

sharing an example to do it. you need to replace in source sys id with the sys id of the KB article where attachment is present. In target u need to use sys id of the KB article where u want to copy the attachment.

 

And instead of incident table use KB table name where attachment is present for eg kb_article

 

var sourceSysID = '9c573169c611228700193229fff72400';

var targetSysID = '9d385017c611228701d22104cc95c371';

 

var copyAtt = new GlideSysAttachment();

copyAtt.copy('incident',sourceSysID, 'incident',targetSysID);

 

Thanks,

Danish

 

Dr Atul G- LNG
Tera Patron
Tera Patron

May i know the use case of this please. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************