Issue
Description
This article describes how to republish a retired knowledge article.
Procedure
Create a UI action with condition current.workflow_state=='retired', which will show the UI Action only on retired knowledge articles.
Set up the UI action as follows:
Table: kb_knowledge
Active: true
Show Insert: true
Show update: true
Form button: true
Condition: current.workflow_state=='retired'
Script:
if(current.valid_to <= gs.nowDateTime()){
gs.addInfoMessage('Invalid date.Please enter future date');
current.setAbortAction(true);
}
else
{
current.workflow_state = 'published';
current.update();
}
action.setRedirectURL(current);
The following screenshot shows the UI Action setup.
For Additional Information
The UI action script was found in the Community at https://community.servicenow.com/community?id=community_question&sys_id=7cef47a5dbdcdbc01dcaf3231f9619bc