- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
I was looking for a way to update the image of Knowledgebase article in Fuji or Eureka to something custom (not available in any of the icon lists provided). This field is locked down in a couple of ways. First in the KB form it is limited to choices out-of-the-box from ServiceNow, and In the past the list-view was editable and you could simply insert your image name in the image field. However, in Fuji this field is locked down and not editable from the list view. Well, frankly, I needed a way to update that field for some specialized KB's I had created. This is that way.
NOTE: Since the modifications are against data they will not record into your update set. Therefore put this script into a Fix Script to be run when you move to production.
1. First load your favorite jpg into the ServiceNow Image table.
a. Navigate to System UI -> Images. This will display a list view of the images table.
b. You may want to personalize your list view to include the Updated field. Order by updated date descending.
c. Click the New button. This will display the new Image form.
d. Fill in the following fields:
i. Active: checked.
ii. Category: Knowledge Management. This is optional.
iii. Name: <<name of your image>>.<<jpg,gif,png>>
iv. Image: upload your image (Click to add..).
e. Click the Submit button. Your image will be added to the instance image library with the name you indicated.
2. Create a new Fix Script, or go to Scripts - Background and run the following script. I have filled it in with what I last messed with. You will have to add your own information obviously.
The numberList variable will contain a comma delimited list of the KB articles you want to have the image field modified for.
The addQuery 'title' value is optional, and I only have it in the query to help further constrain the returned values.
The kbRecords.image field will contain the image in the images table that you want inserted into the image field.
// this would be the list of KB articles you want to have the custom image added to.
var numberList = ['CSKB00001','CSKB00002','CSKB00003','CSKB00004','CSKB00005'];
var kbRecords = new GlideRecord('kb_knowledge');
kbRecords.addQuery('knowledge_base.title', 'Discovery EXCELerator');
kbRecords.addQuery('number', 'IN', numberList);
kbRecords.query();
while (kbRecords.next()) {
kbRecords.image = 'DiscoEXCELerator_50.jpg'; // your image name would go here
kbRecords.update();
}
3. Navigate to Knowledge -> Articles -> All. This will display a list view of all articles in the KB.
a. Open one of the articles you changed the icon for.
b. The Image field should now contain your new icon/image.
4. The image fields for the KB articles you specified will be changed. In your browser change your link from:
https://<<instance name>>.service-now.com/navpage.do
To:
https://<<instance name>>.service-now.com/kb_home.do
You should see your new icons appear in the Knowledgebase view.
So, ok, that one is solved. However, it does not appear correctly for Knowledgebase v3. This is something I have researched, but not to the point of diving into the code to try to figure it out.
The real question is: Does anyone know of a way to change these icons in KB v3? Is it some undocumented property? Inquiring minds want to know! 🙂
I would appreciate any feedback on that question. Meanwhile I will be looking at it when I have the time.
Thanks,
Steven Bell
If you find this article helps you, don't forget to log in and "like" it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
