Need to fix this script to create Custom Action in Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 09:48 AM
Hello,
I need to adjust this script to work in the custom action. I'm having trouble trying to adjust it. It also has to be because I have difficulty understanding custom actions and how they work.
Please help adjust this script and if possible the custom action input and output.
var empID = '';
var je = new GlideRecord('incident');
je.addQuery('sys_id', '148c06499790b110df5db8a3f153af64');
je.query();
if(je.next()) {
var comm = je.comments.getJournalEntry(1).toString();
var notes = comm.split("\n");
for(var i=0;i<notes.length;i++){
empID = notes[5];
}
gs.info(empID);
}
thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 09:51 AM
Hi @yjeon92 ,
What are you trying to achieve?
Can you please share your desired output
Thanks and Regards,
Rahul

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 09:52 AM
Custom script actions have inputs to the action itself (from the flow), and then can have inputs at each step. If you need to pass inputs to your script, you must have inputs on the action itself and the script step within the action.
Once you create the inputs and pass the input pill from the action to the step, you can reference them inside your script via inputs.input_name. Similarly you can create outputs by specifying step outputs AND action outputs. You can reference outputs in your script via outputs.output_name.
Without screenshots of how your action is setup unfortunately no one can provide a script that will work. It requires setup done through the flow designer UI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 09:53 AM
My goal is to parse through additional comments to grab the employee id. Incidents are created by our answering service team and I would like to update my incident record by the employee id in the comment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 09:56 AM
You have to configure the inputs to pass in the incident record. If your script works with a static sys_id then you only need to modify it to work with a dynamic action input.