Setting the Configuration item in the Incident form by Matching the Alert short description

Shantanu1
Tera Guru

Hi Experts!

 

I have created a flow designer to get Incidents created via Alerts received.

 

I have a requirement where if the Alert description has letter "CN" then the INC configuration item have an Application CI with sys ID "X". 

 

I am trying to access the Alert data in the below screenshot and return a sys ID for the Configuration item to populated the INC but seems it is failing. Any help will be greatly appreciated.

 

 

Shantanu1_0-1695828048592.png

 

1 ACCEPTED SOLUTION

@Shantanu1 

 

Replace entire code with the following one.

 

var shortDesc = fd_data.subflow_inputs.ah_alertgr.description;

 

if(shortDesc.indexOf("CN") != -1){

return "sys_ID1";

} else {

return "sys_ID2";

}

 

 

Thanks,
Anvesh

View solution in original post

6 REPLIES 6

Awesome! This worked!

 

Many Thanks!!

 

Regards,

Shantanu

Manoj89
Giga Sage

Hi Shantanu,

 

You have to move "return shortDesc" to the end of the script, the "return" statement basically ends the script there and returns value.