Knowledge - calculating 'valid to' date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2014 08:00 AM
Hello,
I am beginning to look at business requirements for Knowledge, and one of the requirements is that the "valid to" date be calculated to 1 year (365 days), based on the "published date".
Is anyone doing something like this?
Are there reasons you wouldn't want to do this?
Does anyone have a java script that is doing this now, and would be willing to share with me?
Thank you!
Julie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2014 10:51 AM
Thank you for this information, I appreciate everyone's help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2014 07:20 AM
Julie,
This is a road map of what we did, not perfect but a decent start:
- Assign Knowledge role to itil users
- Create the following:
- Topic
- Categories (for each topic)
- Knowledge Properties
- List of Roles that (comma-separated) that can see user comments on an article:
- itil,knowledge,knowledge_admin
- List of Roles that (comma-separated) that can see user comments on an article:
- Create Knowledge Workflow for article approval
- Goes to approver
- Approver—approves and the article is published and an email is sent telling them that article was published
- Approver—rejects and is set back to draft stage and an email sent telling them that they need to rework the article.
- Goes to approver
- Modify the Knowledge Valid to
- Set for 6 months out from the current date
- Users can change this, changed depending on what type documentation
- Set for 6 months out from the current date
- Creates a scheduled job that creates an event called
- article.expriing.5days
- doit();
- article.expriing.5days
function doit() {
var gr = new GlideRecord('kb_knowledge');
gr.addQuery("valid_to", "<", gs.daysAgoStart(-5));
gr.addQuery("valid_to", ">", gs.now());
gr.query();
while (gr.next())
gs.eventQueue("article.expiring.5days", gr, "", "");
}
7. Created an Event
1. Article expiring in 5 days
8. Created an Email Notification
1. Email Notification fired off the Article Expiring in 5 Days event
9. Create a scheduled job to retire articles
1. Create a scheduled that runs every day at 6pm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2015 03:45 AM
Hi everyone,
Sorry for coming late. You might already have your answer, but this post will help any person who wants to do the same thing
Please follow the steps below in order to set up the date "Valid to' to 12 months on from the published date :
1. Right click on the 'Valid Field'
2. Click on personalize Dictionnary
3. On default Value tabs, write the script below (ensure that the 'Use dynamic default is unchecked) :
javascript: var dat = new GlideDate(); dat.setValue(gs.monthsAgo(-12));
dat.getDisplayValue();
4. Save
You can find further informations into this wiki : http://wiki.servicenow.com/index.php?title=GlideDateTime#addMonths.28int.29
Do not feel shy to put correct or helpful answer If it solves or helps. You can also like the post
Kind Regards,
ZA