- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 11:28 AM
How to create a change task automatically when a particular category is selected on Change Request form?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 11:48 AM
Hi,
Go to WF editor.. open your change request workflow depending on type.
In that depending on your process.. drag if condition activity. In that add code like below
answer = ifScript();
function ifScript()
{
if(current.category == "YOUR CATEGORY"){
return 'yes';
}else{
return 'no';
}
}
Then for yes.. drag create task activity.
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 11:38 AM
Hello Sasha,
In your CR workflow, you can add a condition if category is your value, then create change task.
Another approach is you can write a after insert BR on change_request table with condition
category is "your value"
var gr = new GlideRecord("change_task");
gr.initialize();
gr.short_description = "your short desc";
gr.description="your desc";
gr.change_request=current.sys_id;
gr.insert();
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2020 01:09 PM
Hi Asif,
Thanks for your help.
Regards,
Sasha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2021 01:14 PM
Created after this question was asked, the Flow Designer now covers this functionality. The "Change - Implementation tasks" (.../$flow-designer.do?sysparm_nostack=true#/sub-flow-designer/6bcd6a92731310108ef62d2b04f6a790) is an out-of-box example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2024 08:57 PM
Hi I have a similar kind of situation along with ootb change tasks I wanted to add a change task if a field in change request called Change Reason field is Decommission/Repair and it should not create task if the same field values are selected as fix or Repair or None. How to achieve this in workflow. Please let me know thank you