Check the status of a Catalog Task as Close Complete or Closed Incomplete in a Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2018 03:06 PM
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.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2018 08:19 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2018 10:02 PM
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.