File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Custom Knowledge Base Auto-Publish
2
+
3
+ This script auto-publishes reviewed Knowledge Base articles, ensuring they are available to users without manual intervention.
4
+
5
+ ## Usage
6
+ - This script is ideal for automating Knowledge Base publishing after an article passes review.
7
+ - Set up as a scheduled job to automate the process.
Original file line number Diff line number Diff line change
1
+ ( function autoPublishKnowledge ( ) {
2
+ // Query for articles marked as ready for publishing
3
+ var kb = new GlideRecord ( 'kb_knowledge' ) ;
4
+ kb . addEncodedQuery ( 'workflow_state=reviewed^valid_to>javascript:gs.now()' ) ;
5
+ kb . query ( ) ;
6
+
7
+ // Auto-publish articles
8
+ while ( kb . next ( ) ) {
9
+ kb . workflow_state = 'published' ;
10
+ kb . update ( ) ;
11
+ }
12
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments