Create a fix script to remove the extra string from the Short description
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2023 07:33 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2023 05:42 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2023 06:14 PM - edited ‎02-21-2023 06:20 PM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2023 05:43 AM
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