Problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2024 02:51 AM
In the problem when the priority is critical or high I need to create a PTASK automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2024 03:11 AM - edited ‎10-21-2024 03:12 AM
Hi @Anantha27 ,
create a new after business rule on problem table with the conditions priority as high or critical.
on advance section use below script.
(function executeRule(current, previous /*null when async*/ ) {
var grPRTASK = new GlideRecord('problem_task');
grPRTASK.initialize();
grPRTASK.short_description = current.short_description;//problem short description
grPRTASK.problem = current.sys_id; //problem sysid
grPRTASK.insert();
})(current, previous);
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2024 03:54 AM
Hi @Anantha27 ,
If priority is Critical/High in Problem, You want to insert a new record in Problem Task:
You have 2 ways to approach this:
1) Flow Designer: If your condition Priority is Critical OR High then you can create a Problem Task with default value. Without any scripting. If you want some field values then configure as per requirement.
2) Through After BR on Insert OR update: You can use script for this to copy fields values of existing problem table to Problem task table.
Use either approach as per your requirement.
If my answer is helpful, then mark it as ''Helpful" and accept as a ''Solution"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2024 12:01 AM
HI @Anantha27
you can use the flow designer. The best way is to create business Rule to create PTASK automatically.