How to add MRVS to sc_task that i created in script on wf?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2024 06:43 AM
Hello !
I have variables set of Multi Row type on catalog item and i need to show this mrvs on tasks that i created on wf with run script .
how can i do that ?
this is the script that creates the tasks :
var equipment_req;
var mrvs = JSON.parse(current.variable_pool.details.toString());
for (var x in mrvs) {
equipment_req = mrvs[x].equipment_req;
gs.log("equipment_req task_management " + equipment_req);
var gr = new GlideRecord('u_equipment_types');
gr.addQuery('sys_id', equipment_req);
gr.addEncodedQuery('u_task_management!=NULL');
gr.query();
while (gr.next()) {
var tsk = new GlideRecord("sc_task");
tsk.initialize();
tsk.request_item = current.sys_id;
tsk.assignment_group = gr.u_task_management;
tsk.short_description = "משימת טיוב";
tsk.state = 1;
current.stage = "משימת טיוב";
current.state = 2;
tsk.insert();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2024 07:45 AM
why not use Catalog Task Activity in workflow and then add it
Did you not add that MRVS variable set from available to selected in the activity?
You can follow below article to achieve the same:
Multi row variable set (MRVS) not visible in catalog task
Multi-row variable set on Catalog Task [sc_task]
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2024 11:07 AM
because i need one more tasks on one step
look the script ...for example if i have 2 row on mrvs i had two task for first care factor .
so catalog task activity this is not the solution for me...