How to add Affected Cls in a catalog task using flow designer in servicenow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 12:48 AM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2023 09:09 PM
To add the Affected CI field to a catalog task using Flow Designer in ServiceNow, you can follow these steps:
- Open Flow Designer and create a new flow.
- Drag and drop the "Service Catalog Task" trigger onto the canvas.
- Configure the "Service Catalog Task" trigger to start the flow when a catalog task is created or updated.
- Drag and drop the "Transform" action onto the canvas, and connect it to the "Service Catalog Task" trigger.
- In the "Transform" action, select the "Affected CI" field from the catalog task data as the input.
- Use a script transform to map the input value to the desired output value. For example, you could use a script transform similar to the following to set the Affected CI field to a specific CI:
(function transformEntry(current, actions, state) {
current.setValue('cmdb_ci', 'CI0000001');
})(data.current, data.actions, data.state);
This script sets the cmdb_ci field to CI0000001. Replace this value with the sys_id of the CI that you want to set.
- Drag and drop the "Update Record" action onto the canvas, and connect it to the "Transform" action.
- In the "Update Record" action, set the table to "Service Catalog Task", and use the "Current record" option for the record to update.
- Map the output of the "Transform" action to the "Affected CI" field in the "Update Record" action.
Now, when a catalog task is created or updated, the flow will automatically set the Affected CI field to the desired value.