- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2015 06:44 AM
Hi folks
Im trying to create an application request workflow with some dynamic instructions. The basic concept is this: A user requests an account to a new application using a form (catalog item) on the ESS portal. In this form the user selects wich application it want access to in a reference field (referencing the cmdb_ci_appl table). The workflow then creates a number of catalog tasks for service desk to setup the new account for the application. One of these tasks needs to contain detailed instructions for how to setup an account for the specific application selected by the user.
This customer has a ton of applications available for end users to order so the workflow need to be quite dynamic and the instructions cant be stored in the workflow itself, instead the instructions are stored as knowledge article in the kb_knowledge table.
The Application request form:
On the application form (in cmdb_ci_appl) there is a reference (to kb_knowledge) to a knowledge article that contains instruction for how to setup a new account for the application.
The Application form:
In the workflow (created on 'sc_req_item') I've tried the following code on the "create catalog task"- activity to insert the article referenced in the field on the application form to the tasks work notes. The variable used to reference the application table in the catalog item is called "specify_application", and the field on the application form referencing the KB article is called "u_user_creation_instruction". As you can see I've tried this using the getHTMLValue() method aswell... however it is not working, the article is not being pasted into the work notes of the catalog task.
-------->
My guess is that the issue has something to do with trying to retrive the html from the referenced article and inserting it into a journal field.
Any ideas on how this can be achieved? Any help is greatly appreciated.
/// Hugo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 05:52 AM
Hi, I did
In the workflow activity to create the Catalog task I added the following lines of code:
To paste the referenced Knowledge article HTML in to the work notes of the catalog task:
task.work_notes = '[code]' + current.variables.specify_application.u_user_creation_instruction.text.getHTMLValue() + '[/code]';
And to insert a clickable Link to the referenced knowledge article in to the work notes of the catalog task:
task.work_notes = '[code]<a target="_blank" href="' + gs.getProperty('glide.servlet.uri') + '/kb_view.do?sysparm_article=' + current.variables.specify_application.u_user_creation_instruction.number + '">'+ current.variables.specify_application.u_user_creation_instruction.number +'</a> [/code]';
I hope it helps you out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 07:02 AM
Hi Ravi
Actually, those were my requirements as well. First the knowledge article (installation instructions) needed to be posted in the work notes of the task so that the instructions were posted as they looked then and there.
Secondly they wanted a link to the KB article to be able to see the current version.
It worked out nicely, the code I posted did the trick.
@Christy , I no longer have access to the customer instance so sadly I can't share a screenshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 07:05 AM
Hi Hugo,
Thanks for confirming!
Ravi