- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 10:29 AM
Hi,
I have created a UI Action on Outage form which creates a KB Article using below script . The requirement is to Submit Knowledge Article in Review state , currently the KB Article is generating Draft state . Could you please help me with the requirement.
Thank you
Uttam Sai S
var kb = new GlideRecord('kb_knowledge');
kb.initialize();
kb.short_description = current.short_description;
kb.text = current.details;
kb.insert();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 08:50 AM
Hi @Uttam Sai ,
You can use UI action as below :-
var kb = new GlideRecord('kb_knowledge');
kb.initialize();
kb.workflow_state = 'review';
kb.short_description = current.short_description;
kb.text = current.details;
kb.insert();
There is on OOB business rule which change the workflow state of KB article as draft before insert. If you make it active false then your UI action will work.
The 2nd method is exclude the KB article created from UI action as below :-
UI action code :-
var kb = new GlideRecord('kb_knowledge');
kb.initialize();
kb.workflow_state = 'review';
kb.short_description = current.short_description;
kb.text = "Article From Outage:"+"\n"+current.details;
kb.insert();
BR edit in condition:-
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 10:31 AM
var kb = new GlideRecord('kb_knowledge');
kb.initialize();
kb.workflow_state = 'review';
kb.short_description = current.short_description;
kb.text = current.details;
kb.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 08:13 AM
Hi @Mike_R ,
The workflow is not getting updated in Knowledge Article form . Could you please help me what else could be done .
Thank you
Uttam Sai S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 08:16 AM
Can you post a screenshot of your UI action?
And also a screenshot of the created KB article?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 08:50 AM