The CreatorCon Call for Content is officially open! Get started here.

Check the status of a Catalog Task as Close Complete or Closed Incomplete in a Workflow

Roy B
Kilo Contributor

Hi,

I am creating a Catalog Task in my workflow and would like to proceed to the next activity depending on the Catalog Task state. The work is running in the sc_req_item table and i would like to check if the Task is Closed Complete then move on to the next activity . If the status is Closed Incomplete, then i want to report an error and create an incident . On the incident i want to update the comments with the comments entered in the task.

Any input is appreciated.

 

2 REPLIES 2

The SN Nerd
Giga Sage
Giga Sage

 

 

In the Task Activity, place the following code in Advanced Script

activity.result = current.state;

 

In your Task Activity condition:

activity.result == 3; 

 

Do this for all your states.

 

From that activity condition, you can create a new Incident in your workflow by Script or Activity.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Mrigank Gupta
Giga Expert

After creating the catalog task in the workflow, you can put a condition in the workflow to check if the state has been changed to Ccosed Incmplete. if it is, proceed with the next use case.