Add Short Description on Knowledge email script

Alex Edmiston1
Giga Guru

Hello -- I'm trying to add the short description field onto the below script but keep getting undefined on the message. Any ideas on what to change? 

 

find_real_file.png

1 ACCEPTED SOLUTION

Eric Viets
Mega Expert

I now just had the same problem and *finally* figured it out.

The code that needs to be modified is in: System Policy… Events… Script Actions.  Activity Fanout Manager for KM

In the function getKnowledgeObject() section, you'll want to add this line:

knowledge_obj.short_description = gr.getValue('short_description');

 

Then, in your notifications, you can add something like:

template.print("<b>Article title</b>: "+obj.short_description+"<br/>");

 

Please mark as helpful/correct answer.  Thanks!

And if someone can get this into baseline code, that would be even better!

View solution in original post

19 REPLIES 19

Cinlin
Giga Expert

Alex,

Did you get this to work?  I am having the same problem and I do not see where the parm 1 and parm 2 fields are in the event registry.  

You just  need to pass the parms in the script, not needed to define in event registry

Here is an example

gs.eventQueue('event_name', current, parm1, parm2)

Cinlin
Giga Expert

Thanks for answering, this what it returns after putting your suggestion in, any thoughts?

An article has been created in the Instrument Systems (IS) Knowledge Base.

Article NumberKB0011498
Published Date: 2019-01-08 10:10:34
{"author":"Cindy Lindsey","created_on":"2019-01-08 10:10:34","knowledge_base":"Instrument Systems (IS)","latest_version":"1.0","number":"KB0011498","receiver":"Chau","revised_by":"","sys_id":"6bf2e3bedb3ae7402389f4b5ae961919","updated_on":"2019-01-08 10:11:34"} 


 
Here is the script:
 
find_real_file.png

Please do the following

  • You need find out which event is triggering the notification and where that event resides. Most probably event might be in a business rule
  • In the business rule you need to update the eventQueue syntax as provided above

 

 

ryan_pope
Mega Guru

In both use cases, it looks like a JSON object is being passed via event.parm2, but that object does not have a short description element in the object. Whatever script you're using to create that object that's being passed into event.parm2 will need you to also include a "short_description":"Short description value" in the object.