- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 07:18 AM
I have a requirement to create change task after submitting catalog item on SP.
so before creating change task, created change request by using create task activity.
Immediately after that used another create task and created change task.
By creating task in this way, change tasks are not coming under the change request .
So created after BR on change request table based on short description.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2023 12:54 AM
Hi @sravya03 Please find the below Business rule condition to create 3 Change task under Change after change creation.
(function executeRule(current, previous /*null when async*/) {
createChangeTask(current, current.assignment_group, 'Description for Task 1');
createChangeTask(current, current.assignment_group, 'Description for Task 2');
createChangeTask(current, current.assignment_group, 'Description for Task 3');
})(current, previous);
function createChangeTask(change, assignmentGroup, description) {
var gr = new GlideRecord("change_task");
gr.initialize();
gr.assignment_group = assignmentGroup;
gr.state = '1';
gr.description = description;
gr.change_request = current.sys_id;
gr.insert();
}
Cheers, hope that helps
Eswar Chappa
*** Please mark as "Correct" or "Helpful" as appropriate ***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 08:58 AM
Hi @sravya03 in the above BR you can be able to create one task under change request ,Can you please specificy your requirement bit more elaborative manner for better understanding
Thanks & Regards
Eswar Chappa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 09:03 AM - edited ‎08-18-2023 09:04 AM
@Eswar Chappa I want 3 change tasks to be created(simultaneously) under one change request with diff assignment groups and description.
I need script to achieve that,I have written the above script but only one change task is getting created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2023 12:54 AM
Hi @sravya03 Please find the below Business rule condition to create 3 Change task under Change after change creation.
(function executeRule(current, previous /*null when async*/) {
createChangeTask(current, current.assignment_group, 'Description for Task 1');
createChangeTask(current, current.assignment_group, 'Description for Task 2');
createChangeTask(current, current.assignment_group, 'Description for Task 3');
})(current, previous);
function createChangeTask(change, assignmentGroup, description) {
var gr = new GlideRecord("change_task");
gr.initialize();
gr.assignment_group = assignmentGroup;
gr.state = '1';
gr.description = description;
gr.change_request = current.sys_id;
gr.insert();
}
Cheers, hope that helps
Eswar Chappa
*** Please mark as "Correct" or "Helpful" as appropriate ***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2023 07:13 AM
Thanks for the help.
Need one more help on other requirement.
I have to create 2 change requests through Workflow which is on sc_req_item table.
I have used create task and created but that change request number is not visible on request item form(in related list 'change request' tab).
Is there anything can be done