Resetting News Article Views

MeganCox
Tera Expert

If we are doing a rebrand of our News Article formats, is there a way to reset the view count on the news article? I checked in the content record and can see the views there. I thought maybe I could just click the people and delete, but that option is greyed out. 

Is there any other way than cloning each article and setting the old ones inactive?

9 REPLIES 9

There might be some sort of plugin or subscription applied because I don't have this option.

 

However use the code I shared above, adjust the query accordingly, if you are selecting these types it will most likely by a knowledge article with type or category to use in the condition. I cannot tell because I don't have this available in my PDI

---
Where the rules are real, you'll find me

Tanushree Maiti
Tera Patron

Hi @MeganCox 

 

Refer: KB0787113 How to reset the knowledge view count to 0? 

 

Also check : How can we reset the view count and use count of knowledge Article? 

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Pooja_Patil
ServiceNow Employee

@MeganCox currently delete is restricted for sn_ce_view intentionally. If you have maint access, you can use background script to delete views.

If I'm not a coder at all, can you give me a little more information on how to do this so I can pass this on to my developer to complete for me?

Pooja_Patil
ServiceNow Employee

If the dev has access to run background script in sn_ce scope (caution rollback may not be possible) - 

var gr = new GlideRecord('sn_ce_view');
gr.addQuery('item', '<replace_with_sys_id_of_the_content>');
gr.query();
gr.deleteMultiple();