Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

flow designer: assign remediation task based on word in short description field

Jay_N
Tera Contributor

I am trying to create a flow designer for the follow conditions:

 

Trigger: When remediation task is created.

Whenever a remediation task is created, I would like the flow to search for a specific word in the "short description" field and based on that word, assign it to a specific users. So for example:

 

Short description contains "Windows", assign to analyst A

Short description contains "Linux" assign to analyst B etc.

 

I have about 20 different analysts that would like to add to the flow. Any help in how to accomplish this would be appreciated.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Jay_N 

2 approaches

1) Flow designer -> you can use inline script for this to assign the task and use Flow Variable logic

Something like this

var userSysId = '';
var shortDescription = fd_data.trigger.current.short_description.toString().toLowerCase();
if(shortDescription.indexOf('windows') > -1)
userSysId = 'analystASysId';
else if(shortDescription.indexOf('linux') > -1)
userSysId = 'analystBSysId';
return userSysId;

flow variable logic.gif

2) Assignment rules

Defining assignment rules 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Dr Atul - LNG
Tera Patron

Hi @Jay_N 

Practically, it's not the right approach to search in the short description. Sometimes, a short description might have variations like "Window" or "windows," or extra spaces at the beginning or end, causing the search to fail. It’s better to keep it in a reference field instead.

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************

Ankur Bawiskar
Tera Patron

@Jay_N 

2 approaches

1) Flow designer -> you can use inline script for this to assign the task and use Flow Variable logic

Something like this

var userSysId = '';
var shortDescription = fd_data.trigger.current.short_description.toString().toLowerCase();
if(shortDescription.indexOf('windows') > -1)
userSysId = 'analystASysId';
else if(shortDescription.indexOf('linux') > -1)
userSysId = 'analystBSysId';
return userSysId;

flow variable logic.gif

2) Assignment rules

Defining assignment rules 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

vermaamit16
Kilo Patron

Hi @Jay_N 

 

You can use a Decision Table to store Keyword vs Analyst mapping as shown below and call the decision table within the flow to get the relevant analyst.

AmitVerma_0-1745574883336.png

 

Thanks and Regards

Amit Verma

Thanks and Regards
Amit Verma