
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 09:05 AM
Our company is using the knowledge base with versioning in place. We've noticed that since upgrading to New York, a peculiar behavior in the "Valid to" date is occurring.
- When creating a new KB article, the valid to date is set for one year out from the date of creation. This is the behavior we want, as authors are expected to review articles once a year.
- When checking out an existing KB article to update, the valid to date sets to January 1, 2100. An informational message displays that the valid date has been updated.
I opened a case with ServiceNow and they seem to say this is expected/designed behavior. I looked at the code behind the "Checkout" UI action and it appears to be written in there to update the date. My plan is to create a copy of this UI action, revise the statement that changes the valid to date, deactivate the OOB button and activate my custom copy.
Here's my reason for posting:
1) the code replacement is a bit of a stretch for me, so if anyone can point me in the right direction of an example of how to grab the current system date and add 365 days to it, I would appreciate the help.
2) anyone else think that resetting the new version's date to nearly eighty years out is kinda odd? Or is that just me?
Solved! Go to Solution.
- Labels:
-
Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2020 09:11 AM
Hi,
I am a product manager of the ServiceNow Knowledge Management.
You do not need any customization. We added a new field called "Article Validity" to the knowledge base in New York (if you do not see the field on the knowledge base form, just add it to the form by changing the form layout). This field helps you dynamically set the valid_to date.
It takes number of days as input. In the above screenshot, the article validity of the knowledge base is set to 365 days. So all articles created or checked out in the knowledge base will have their valid to set to 365 days from the date of creation.
You can even set a different article validity for each knowledge base, if needed, for your process requirements.
Regards,
Lokenath Chakraborty

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 09:13 AM
Hi,
This is standard behavior and was recently update because before it was resulting in ending in 2020...well..here we are so they have to change it. Not all articles are valid for 1 year...so that may be your process, but some, they don't retire for quite some time or forever, so they just set it so far out that it's a non-issue. You can change this yourself if needed.
You can change the default value for that field.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 09:15 AM
Hi there,
Don't know why it's getting overwritten, have to reproduce this. Though the where the 2100 is coming from:
Script Include "KBCommonSNC". It literally mentions a setValue("2100-01-01")
This is Script Include and the specific function are called in the Default Value for the Valid to field on kb_knowledge.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 11:24 AM
Thanks for your thoughtful and helpful responses. After further research, it appears the core issue is that the value of the "Valid to" field is being overwritten. And it looks like the issue will be addressed in the Patch 8 of New York (we're currently running 7a).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 11:45 AM
Hello,
Alright, well, you mentioned two issues so I only addressed one of them which is still relevant and won't be corrected with the patch. So, let me know if you end up using that or not since you mentioned you didn't prefer the valid to date supplied and asked for a custom solution to take today and add a year to it and use that going forward.
Thanks
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!