- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:15 AM
We have created Catalog item for service request. By default its going for approval. How do we need to skip approval and create Task automatically.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:19 AM
Hi @sri001
ho to maintain items, in related process engine list, check the flow. make them duplicate and edit according to your requirement and remove the approval task from there.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2024 02:25 AM
Hi @sri001
Option 1: Modify Workflow
If your catalog item uses a workflow for handling approvals and task creation, you will need to modify this workflow to skip the approval phase.
1. Navigate to the Workflow Editor: Go to Workflow > Workflow Editor from your ServiceNow navigation pane.
2. Open the Relevant Workflow: Search for and open the workflow associated with your catalog item. The workflow is typically assigned through the Catalog Item form in the “Workflow” field.
3. Modify the Workflow:
- Locate the Approval Activity in the workflow.
- Either delete the Approval Activity (if approvals are not needed at all) or modify its conditions to bypass certain conditions where approval isn’t required.
- Ensure there’s a direct path from the initial stage to the Task Creation Activity.
4. Publish the Workflow: After making the necessary adjustments, publish your workflow so the changes take effect.
### Option 2: Use Business Rules
If your process is simple or doesn’t use complex workflows, you might want to use a Business Rule to automate task creation without an approval phase.
1. Create a New Business Rule: Go to System Definition > Business Rules and click on New.
2. Configure the Business Rule:
- Name: Give it a descriptive name.
- Table: Select “Requested Item [sc_req_item]” or a relevant table if your process uses a different one.
- Advanced: Check this option because you’ll likely need to input a script.
- When to run: Configure it to run “After” an insert or update operation, based on your process. E.g., You might want it to trigger after a catalog request is submitted (inserted).
- In the Condition field, specify any conditions under which this business rule will run (e.g., specific catalog items or conditions where approval is not necessary).
- Script: Write a script that automatically creates the task(s) associated with the catalog item. This will involve using the GlideRecord API to create records in the task table or any specific task tables like incident, change, etc.
var gr = new GlideRecord('sc_task');
gr.initialize();
gr.request_item = current.sys_id;
gr.short_description = 'Auto-generated task for ' + current.number;
// Set other necessary fields according to your task form
gr.insert();
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 11:35 PM
Hi @Deepak Shaerma,
Thank you for the help. Can you please tell me how to close the RITM automatically once task is closed with help of above business rule.
And one more, once we have created flowdesigner and added in catalog item, the flow is not working from RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:19 AM
Hi @sri001
ho to maintain items, in related process engine list, check the flow. make them duplicate and edit according to your requirement and remove the approval task from there.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:58 AM
There was no flow selected in related process Engine. Even its going an approval. Please help to skip the approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2024 02:25 AM
Hi @sri001
Option 1: Modify Workflow
If your catalog item uses a workflow for handling approvals and task creation, you will need to modify this workflow to skip the approval phase.
1. Navigate to the Workflow Editor: Go to Workflow > Workflow Editor from your ServiceNow navigation pane.
2. Open the Relevant Workflow: Search for and open the workflow associated with your catalog item. The workflow is typically assigned through the Catalog Item form in the “Workflow” field.
3. Modify the Workflow:
- Locate the Approval Activity in the workflow.
- Either delete the Approval Activity (if approvals are not needed at all) or modify its conditions to bypass certain conditions where approval isn’t required.
- Ensure there’s a direct path from the initial stage to the Task Creation Activity.
4. Publish the Workflow: After making the necessary adjustments, publish your workflow so the changes take effect.
### Option 2: Use Business Rules
If your process is simple or doesn’t use complex workflows, you might want to use a Business Rule to automate task creation without an approval phase.
1. Create a New Business Rule: Go to System Definition > Business Rules and click on New.
2. Configure the Business Rule:
- Name: Give it a descriptive name.
- Table: Select “Requested Item [sc_req_item]” or a relevant table if your process uses a different one.
- Advanced: Check this option because you’ll likely need to input a script.
- When to run: Configure it to run “After” an insert or update operation, based on your process. E.g., You might want it to trigger after a catalog request is submitted (inserted).
- In the Condition field, specify any conditions under which this business rule will run (e.g., specific catalog items or conditions where approval is not necessary).
- Script: Write a script that automatically creates the task(s) associated with the catalog item. This will involve using the GlideRecord API to create records in the task table or any specific task tables like incident, change, etc.
var gr = new GlideRecord('sc_task');
gr.initialize();
gr.request_item = current.sys_id;
gr.short_description = 'Auto-generated task for ' + current.number;
// Set other necessary fields according to your task form
gr.insert();
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 11:35 PM
Hi @Deepak Shaerma,
Thank you for the help. Can you please tell me how to close the RITM automatically once task is closed with help of above business rule.
And one more, once we have created flowdesigner and added in catalog item, the flow is not working from RITM.