- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2016 04:53 AM
We want to allow a user to edit an existing article but when that article is being edited we want the existing article to stay live and the new article to go through an approval process. The new article would then replace the old article once it has been approved. how can this be done?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2016 03:16 PM
Although we are reevaluating everything under knowledge V3, we have been using a business rule: Anybody can fiddle with a published knowledge article, but if a change is detected, a copy of the article is created with the words "Copy of" prepended to the short description of the copy, and the copy's state is set to "Review." A temporary advisory alert is posted on the knowledge edit form when this happens.The original is untouched.
Downsides: Some people with fat fingers can create "copy of" articles, often for invisible, insignificant, and unconscious changes made while the are reading an article. Knowledge writers can create a lot of "copy of" versions and be left wondering why their changes don't show up (especially when they can't view articles in "review" state). (Sometimes they make multiple copies while repeatedly trying to perform the same update). And some editor has to monitor the "copy of" articles in review and use relatively crude compare steps to see what was changed and whether the changes belong in the published article.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 11:22 AM
Jim - can you post a copy of the business rule you used? I am curious how you implemented it. I can think of a couple ways, but I am wondering what you found works best. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 02:56 PM
Here's the code ... you may need some other pieces but I won't be able to respond until late in the month.
--------------------------------------------------------------------------------------------
gs.addInfoMessage('The modified knowledge article is being reviewed. Thank you.');
copyKBarticle(); // Copy the original KB
current.setAbortAction(true);
action.setRedirectURL(current);
//current.workflow_state = 'review'; // Set state to review
function copyKBarticle() {
//this function creates a copy record on the knowledge base table
var kbID = current.sys_id.toString();
var kb_article = new GlideRecord('kb_knowledge');
kb_article.initialize();
kb_article.sys_id=current.sys_id;
kb_article.number = current.number;
kb_article.topic = current.topic;
kb_article.u_genres=current.u_genres;
kb_article.published=current.published;
kb_article.valid_to=current.valid_to;
kb_article.image=current.image;
kb_article.sys_created_by=current.sys_created_by;
kb_article.author=current.author;
kb_article.article_type=current.article_type;
kb_article.workflow_state='review';
kb_article.roles = current.roles;
kb_article.display_attachments = current.display_attachments;
kb_article.category = current.category;
kb_article.short_description = 'Copy of '+current.short_description;
kb_article.text = current.text;
kb_article.insert();
//Copy attachments for this change
if (typeof GlideSysAttachment != 'undefined')
GlideSysAttachment.copy('kb_knowledge', kbID, 'kb_knowledge', kb_article.sys_id);
else
Packages.com.glide.ui.SysAttachment.copy('kb_knowledge', kbID, 'kb_knowledge', kb_article.sys_id);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 07:46 AM
Jim, I tested your script and it is great! Thank you for saving me so much time! I did notice two things and I was wondering how you handled them:
1. I notice that you aborted the update in order to prevent the current record from being overwritten - this causes a message to pop up that says "invalid update" - is there way to suppress this - or do we just teach the knowledge managers that this is expected?
2. My system (Geneva P4) has an OOB global business rule running after insert that sets the workflow state back to draft - overriding what your script does. Did you just turn off the BR or did you do something so that the BR wouldn't run when the inserts are caused by this edit script?
Thank you again for sharing your work - you saved me quite of bit of effort since I am just beginning to figure out the scripting thing.
Frank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2016 03:59 PM
But it says anyone with any role can create or view. All our users have roles so how is that going to prevent them from creating anything? I've used the can contribute functionality and all it seems to do is restrict or allow access to editing but not creating articles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2023 08:23 AM
Has an enhancement been made for this?