File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Client-Side Components/UI Actions/Publish a Retired Knowledge Article again Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1+ var kbArticle = new GlideRecord ( 'kb_knowledge' ) ;
2+ kbArticle . setWorkflow ( false ) ;
3+ kbArticle . addQuery ( 'article_id' , current . article_id ) ;
4+ kbArticle . addQuery ( 'sys_id' , "!=" , current . sys_id ) ; //articles that are not the current one
5+ kbArticle . addQuery ( 'workflow_state' , 'retired' ) ;
6+ kbArticle . query ( ) ;
7+ while ( kbArticle . next ( ) ) {
8+ kbArticle . workflow_state = 'outdated' ; //setting the articles as outdated
9+ kbArticle . update ( ) ;
10+ }
11+ current . workflow_state = 'published' ; //publishing retired kb article again
12+ current . published = new GlideDate ( ) ;
13+ current . retired = "" ; //clearing retired field value
14+ current . update ( ) ;
15+ action . setRedirectURL ( current ) ;
You can’t perform that action at this time.
0 commit comments