I want to trigger a task based on MRVS choice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2024 11:40 PM
I am trying to trigger a task in workflow based on choice selected in MRVS.
I am trying to do in a script using a if in workflow but it is not triggering.
var testRoles = [
'sys_id of choice1 in selectbox',
'sys_id of choice2'
];
var mrvs = current.variables.mrvs_name;
try {
var actions = JSON.parse(mrvs);
} catch (ex) {
gs.error('Failed to parse mrvs due to error: ' + ex);
return 'no';
}
for (i = 0; i < actions.length; i++) {
//if (actions[i].hasOwnProperty('variame_name_of_choice') &&
if (testRoles.indexOf(actions[i],variame_name_of_choice) != -1) {
return 'yes';
}
return 'no';
}
}
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2024 11:51 PM
Hi @Taaha M ,
Please refer the below links.
Please mark my answer as helpful and correct if it helps to resolve your issue.
Regards,
Namrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 01:21 AM
I am trying to trigger based on choice selected on field.