when sctask work note updated need to create the incident using flow designer

Vinod S Patil
Tera Contributor

Hello  Everyone

I have requirement when Sc_task's work note updated and if it contains the text ' file creation failed' need to create the incident using flow designer.

I tried it but its not working as expected can you please help me on that and have look at below screen shot.

VinodSPatil_0-1759846868747.png

 

VinodSPatil_1-1759846903201.png



@Ankur Bawiskar 

2 ACCEPTED SOLUTIONS

@Vinod S Patil 

do this as alternative and it should work fine for you

1) create flow variable of type True/False

2) then use Set Flow Variables flow logic to set that flow variable based on matching condition

3) then use that Flow variable in your IF logic

flow work notes changes and search and match.gif

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

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

View solution in original post

@Vinod S Patil 

To implement your requirement, here are the detailed steps to create a flow that triggers when a worknote containing "file creation failed" is added to a Catalog Task.

1. Create a Flow with the Following Trigger:

  • Trigger: Updated

  • Table: Journal Entry [sys_journal_field]

  • Condition:

    • Name is sc_task

    • Element is work_notes

    • Value contains file creation failed

This will ensure that the flow triggers whenever someone posts a worknote on a Catalog Task containing the text "file creation failed".

MIftikhar_0-1759928055458.png

2. Add the Following Steps:

Step 1: Lookup Record Action

  • Add an action to Lookup Record in the Catalog Task Table (sc_task).

  • Set the filter condition:

    • Sys ID = Trigger - Record Updated > Journal Entry Record > Element ID

    • Item = {SELECT YOUR REQUIRED CATALOG ITEM}

  • Set Don't fail on error as checked

This step will fetch the Catalog Task record associated with the worknote, but only if it's for the desired catalog item.

MIftikhar_5-1759928546919.png

Step 2: Add an IF Flow Logic

  • Add an IF flow logic to check if the record exists.

  • This ensures that an Incident will only be created for the Catalog Task associated with the specified catalog item when the worknote contains "file creation failed"

MIftikhar_2-1759928205827.png

Step 3: Create Record on Incident Table

  • Under the IF condition, add the action "Create Record" on the Incident table.

  • This action will create a new Incident record based on the conditions you’ve set.

MIftikhar_3-1759928223371.png

Successful Execution Screenshot

Here’s a screenshot of the flow successful execution:
Positive case:

MIftikhar_4-1759928315701.png

Negative Case: when the catalog item was not the selected one

MIftikhar_6-1759928649973.png


If my response helped, please mark it as the accepted solution so others can benefit as well.

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

View solution in original post

15 REPLIES 15

@Vinod S Patil 

Hence this is your only way to use CONTAINS operator on sys_journal_field like in your case in flow designer, work_notes to check the CONTAINS text. 

 

MIftikhar_0-1759924893214.png

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

@Vinod S Patil 

These two links will also help to understand 

 

In this article, as the guy suggesting, to store that value in another string type field, then you would be able to use the CONTAINs operator in flow designer, or the way I have shown you with 3 conditions in flow designer. 

 

Hope it helps. 

https://www.servicenow.com/community/som-forum/question-quot-contains-quot-or-quot-does-not-contain-...

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0529930

 

 

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

@Vinod S Patil 

To implement your requirement, here are the detailed steps to create a flow that triggers when a worknote containing "file creation failed" is added to a Catalog Task.

1. Create a Flow with the Following Trigger:

  • Trigger: Updated

  • Table: Journal Entry [sys_journal_field]

  • Condition:

    • Name is sc_task

    • Element is work_notes

    • Value contains file creation failed

This will ensure that the flow triggers whenever someone posts a worknote on a Catalog Task containing the text "file creation failed".

MIftikhar_0-1759928055458.png

2. Add the Following Steps:

Step 1: Lookup Record Action

  • Add an action to Lookup Record in the Catalog Task Table (sc_task).

  • Set the filter condition:

    • Sys ID = Trigger - Record Updated > Journal Entry Record > Element ID

    • Item = {SELECT YOUR REQUIRED CATALOG ITEM}

  • Set Don't fail on error as checked

This step will fetch the Catalog Task record associated with the worknote, but only if it's for the desired catalog item.

MIftikhar_5-1759928546919.png

Step 2: Add an IF Flow Logic

  • Add an IF flow logic to check if the record exists.

  • This ensures that an Incident will only be created for the Catalog Task associated with the specified catalog item when the worknote contains "file creation failed"

MIftikhar_2-1759928205827.png

Step 3: Create Record on Incident Table

  • Under the IF condition, add the action "Create Record" on the Incident table.

  • This action will create a new Incident record based on the conditions you’ve set.

MIftikhar_3-1759928223371.png

Successful Execution Screenshot

Here’s a screenshot of the flow successful execution:
Positive case:

MIftikhar_4-1759928315701.png

Negative Case: when the catalog item was not the selected one

MIftikhar_6-1759928649973.png


If my response helped, please mark it as the accepted solution so others can benefit as well.

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Ankur Bawiskar
Tera Patron
Tera Patron

@Vinod S Patil 

is the IF condition getting evaluated as TRUE?

are you comparing the exact TEXT?

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

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

@Ankur Bawiskar  no its getting false