- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 01:45 AM
Hi there,
Through a SelfServicePortal (SSP) form ("Record Producer"), I want to create or edit an Knowledge Article.
Creating one works, although the Workflow State keeps being "Draft"; it won't become "Published".
I have tried several options to solve this problem;
- Put Workflow State value in script as tekst without capital letter "P".
- Same, but with capital "P".
- Put Workflow State value in script as "sys_id" (the "sys_id" of the Workflow State "Published").
- Made a (for now) hidden field in the Record Producer (SSP form), which is mapped to the field "Workflow" as type "Reference" within Record Producer table "kb_knowledge" and as reference (tab "Type Specifications") to the "sys_dictionary". I have also tried to setup an Default Value within that tab ("sys_id" of the Workflow State, textual variant, etc.).
Sadly, the Workflow State keeps being "Draft". Is it possible to solve this problem and how?
Thanks!
Solved! Go to Solution.
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 08:41 AM
I fixed this by using the Flow Designer. You can change the Workflow States per article by executing the flow/change as "System User", but keep in mind you will need a good trigger condition.
If you are good enough with Javascript and know how to process a certain user with sufficient rights to change the workflow in the script, you can do it that way. In any case, I solved it for myself by using the Flow Designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 05:24 AM
Hi
What I have understood from the description above, you are trying to create a Knowledge article which should be created directly in Published state and not in Draft state.
So you need to update your Record Producer script as below:
current.workflow_state=published;
This is the value which will be required to set the Workflow of the knowledge article to Published. Another point you need to ensure while creating Knowledge article you need to set the few other attributes as well as mentioned below:
current.kb_knowledge_base = 'Sys ID of the Knowledge base';
current.short_description = 'value of Short Description of Knowledge';
current.workflow_state=published;
Let me know how this goes and if you are stuck do let me know.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 07:49 AM
It looks like this does not work.
I'm sending the things as "Short description", "Description" and "Category" through the Record Producer (mapping) to the Knowledge Base article.
All this fields are filled in correctly. I'm no expert (just a rookie), and I think that adding the code below in the script, is not needed. This because the current Knowledge Base "sys_id" and "Short description" (and a few other fields) are already send (by mapping) to the Knowledge Article.
current.kb_knowledge_base = 'Sys ID of the Knowledge base';
current.short_description = 'value of Short Description of Knowledge';
Using this code only, does not work;
current.workflow_state=published;
Even using the code below, doest not work. But I don't know if it's the correct code as well.
set.workflow_state=published;
This does also not work:
(function executeRule(current, previous /*null when async*/) {
var kb = new GlideRecord("kb_knowledge");
kb.workflow_state=published;
})(current, previous);
I have tried this as well, but the article keeps coming in "Workflow = Draft".
This can be the reason why the config from above does not work?
EDIT: This seems not the reason (tried without default value).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 05:38 AM
Hi
Please let me know if you have a follow up query on this, else if your query is Resolved please mark my answer as correct and close this thread for others.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 07:15 AM
Hi Shloke,
I had no time to try yet, but will do asap and update this thread. 🙂