Copy First Additional Comment from RITM and populate on description of Catalog task

martin63
Tera Contributor

Hello All,

I need functionality to copy First additional comment  from Requested item and want to populate that in description of catalog task. I have created flow in flow designer and want to copy First additional comment  from Requested item and want to populate that in description of catalog task through script in data pill..

I have tried but it is getting current:

**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/


var additionalcomment = fd_data.trigger.current.additional_comment;
return additionalcomment;
 
 
Any solution please help!!!
9 REPLIES 9

Harish KM
Kilo Patron
Kilo Patron

Hi In your create catalog task action put this code under field value for description. This will populate commetns to task description

var comments = fd_data.trigger.request_item.comments.getJournalEntry(1);
return comments;
Regards
Harish

I have created action script as it is not coming in correct format it is populated in one line as rendering HTML so can you guide me on this it is giving me undefined

(function execute(inputs, outputs) {
  
  var add = inputs.record.comments.getJournalEntry(1);

  var comments = add.record.replace('\n', '<br>');
  outputs.comments = comments;
 

})(inputs, outputs);

 

 

please help 

You can do like this Input.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");
Regards
Harish

Hello can you check is any thing wrong I have pasted this is catalog task of flow in description field..

var comments = fd_data.trigger.ritm.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");
return comments;
 
but still not working coming in one line.