- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 11:28 AM
Hi, I am changing out an Inbound Email Action for a Flow created in designer. The Inbound Email action creates an incident record for job failures executed by our Job Scheduling software. I have a custom CMDB table where Job CIs are maintained. Since the same Job Name can run on different servers, a job CI name is uniquely identified by it's display_value (jobName@thisServer). In the inbound email action, I take two values from the email body, jobname and server, and use those values to do a glide record query passing the return value into the incident as the cmdb_ci (Configuration Item)
var server = email.body.server;
server = server.substr(0, server.indexOf("_"));
var jobname = email.body.jobname;
jobname = jobname.trim();
var dn = jobname + "@" + server;
var theJob = new GlideRecord('cmdb_ci_batch_job');
theJob.addQuery('u_display_name', dn);
theJob.query();
while (theJob.next()) {
current.cmdb_ci.setDisplayValue(theJob.name);
}
In the flow I am trying to use the lookup record
My thought was I could use a script to satisy the Display Name Is condition
var server = fd_data.trigger.body_text.server;
server = server.substr(0, server.indexOf("_"));
var jobname = fd_data.trigger.body_text.jobname;
jobname = jobname.trim();
var dName = jobname + "@" + server;
return dName
But using the script button seems to remove the condition itself. That is when I add that little script, save the flow and then reopen that step, the "Display Name is" portion is gone or empty. Testing shows nothing was passed. Am I using the Script capability wrong??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 03:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 03:35 PM
I fixed this by realizing that I had to return an encoded query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2023 02:14 PM
Can please post the exact query you have use, I am trying to implement a similar kind of solution , however it is not working for me as I need pass a variable in the encoded query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 07:59 AM
Hi,
Did you achieve this by adding scripted condition on your flow only, if so whats your final script?