- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2020 12:44 PM
Hi All,
This is regarding the knowledge articles that I want to republish the retried articles.
I have tried the way suggested on community that I have a created a UI action named as publish that is only for articles that are retried using below script & logic. But it is not working, a UI button has sucessfully come on KB form but everything is greyedout even though I have impersonated with the assigned to user. But it is still greyed out. I am unable to edit the Valid to field on KB form.
when I am clicking on Publish button that I have created on the form for retrired articles not working as expected.
Please refer below script & UI action and also please suggest a another way or make my corrections in this .
Method->
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);
Thanks/Utkarsh
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2020 07:39 AM
Hi Utkarsh,
It was missed. Try below.
var kbis=new GlideRecord('kb_knowledge');
kbis.addEncodedQuery('workflow_state=retired');
kbis.query();
while(kbis.next())
{
kbis.valid_to='28-06-2020';
kbis.update();
}
This sets the date in future to retired articles then you can use Republish option as suggested above.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2020 05:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 12:38 PM
Hi Jaspal,
Thanks for this easier & smartest solution to republish the bulk articles.
But I am facing some issue here is that I have selected two types of retired articles that is having date in (valid_to) field before the current date when I am republishing this articles it got successfully republished but after some time like 4/5 mins later it is automatically changes it states from published to retired. In other case of retired article (valid_to) field is having empty data means there is no date in that but the article is retired. When I am republishing this articles it got successfully republished & there is random date came in (valid to) field which the assigned can change & also it remains republished.
So could you please help with the first scenario how to deal with that when retired articles are having valid to date previous that current date & we are republishing them but after some time they again got retired.
Thanks/Utkarsh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 12:50 PM
Hi Utkarsh,
For the first case what is the date set. Does it remain the same?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 01:02 PM
yes it does remain same e.g 2019-04-03 so after republishing it remains the same & after 3/4/5/10 mins it got automatically retired until assignee of that particular assignment group will change the date to future date than it will remain published.
But Jaspal this will not resolve our issue as we are approx 100+ articles that are having valid_to date before the current date. And also valid_to field is not editable for us it is only editable for the member of that assignment group. So till the time we republish the articles than in 5/6 mins they will get retired so how can a assignee change the valid to date to future date.
Please suggest a feasible solution for this scenario.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 01:14 PM
Hi Utkarsh,
Editable by Assignment Group members? I thought you were doing this as an Admin. If yes, Valid To should be editable. Also, for the retried articles that has Valid To date before Current date you can get a filter applied & set the date to something that is in future in bulk.
Once done you can then republish the same thus ensuring it will not retire after 5-10 minutes.