If 'Valid to' field is left empty, then knowledge article should not expire....

Community Alums
Not applicable

If 'Valid to' field is left empty in knowledge article, then article should not expire and should be visible in service portal.

How can we achieve this?

 

valid to.png

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Community Alums 

 

By default is set 01-01-2100. So it will be alive till time and then expire. 

*************************************************************************************************************
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]

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

Community Alums
Not applicable

Hello @Dr Atul G- LNG, the requirement is to not populate any date in it, and if left blank/empty, article should not expire and should be visible in service portal.

 

By OOB, when 'valid to' is left empty, we get a info message on top of the knowledge article saying "Article expired" as shown in image and the article will also not be visible in service portal.

 

Where I can modify so that even after 'valid to' is left blank, it should be visible in service portal.

Hi @Community Alums 

 

Greetings!!

 

 In that case we need to update workflow/ flow. Also may i know why you keep this field as blank.

*************************************************************************************************************
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]

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

Deepak Shaerma
Kilo Sage

Hi @Community Alums 

 

### 1. Modify the Knowledge Article View Configuration

The visibility of Knowledge Articles on the Service Portal is often controlled by configurations related to how these articles are queried and displayed. These configurations could be in the form of widget settings on the Service Portal or ACLs (Access Control Lists) that control access based on article properties.

Widget Configuration:

- If there’s a specific widget on the Service Portal that displays Knowledge Articles, check its configuration to ensure it doesn’t filter out articles based on the “Valid To” date being empty or past.
- Widgets might use encoded queries or specific logic to fetch articles. You may need to adjust this logic to include articles with an empty “Valid To” field.

Access Control Lists (ACLs):

- Review ACLs that apply to the Knowledge Article [kb_knowledge] table, especially those that might restrict read access based on the “Valid To” date field.
- You might need to create or modify an ACL rule to ensure that if the “Valid To” date is empty, the article can still be read.

### 2. Adjust Article Expiration Logic

By default, Knowledge Articles might be set to expire based on their “Valid To” date. You may need to adapt this logic:

Business Rules or Scheduled Jobs:

- Check for any Business Rules or Scheduled Jobs that automatically update article states based on the “Valid To” date.
- If such logic exists, adjust it to account for scenarios where the “Valid To” date is empty, ensuring those articles remain active.

### Example Script for a Business Rule:

(function executeRule(current, previous /null when async/) {

    // Check if ‘Valid To’ field is empty
    if (current.valid_to.nil()) {
        // Logic to ensure the article does not expire
        // For example, set the article state to a non-expired value
        current.state = ‘published’; // Assuming ‘published’ is a state that indicates non-expiration
        current.update();
    }

})(current, previous);

 

Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help us alot.
Thanks & Regards 
Deepak Sharma