The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Create a fix script to remove the extra string from the Short description

Nandini Mishra
Tera Contributor

I need to remove the string starting with "IT Support:" from all the knowledge articles short descriptions. i.e if the short description is "IT Support: How to enable user account" then it should rename to "How to enable user account". Need to update the short descriptions of all the knowledge articles starting with "IT Support:"
Can someone help me how to write the script?

7 REPLIES 7

Hi Basheer,

 

Thank you for the response, in addition i also have the sys_id's of the articles appended to the short description, how can i remove that too from the name?

eg: "IT Support:da1b51ab1b63cc90c001a8a4bd4bcb39 "How to enable user account" 

where "da1b51ab1b63cc90c001a8a4bd4bcb39" is the sys_id of the article

Abhay Kumar1
Giga Sage

@Nandini Mishra please try below,

 

var grKb = new GlideRecord('kb_knowledge');
grKb.addEncodedQuery("short_descriptionSTARTSWITH IT Support:^latest=true");

grKb.setValue('short_description') = grKb.getValue('short_description').replace('IT Support:','');

grKb.setWotkflow(false);

grKb.updateMultiple();

 

Hope this will help you.

Thank you for the response, in addition i also have the sys_id's of the articles appended to the short description, how can i remove that too from the name?

eg: "IT Support:da1b51ab1b63cc90c001a8a4bd4bcb39 "How to enable user account" 

where "da1b51ab1b63cc90c001a8a4bd4bcb39" is the sys_id of the article