Is there a way to run a Script within a workflow and make tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 11:43 AM
Hello, I have a complex problem I'm trying to solve, is there a way to run a Script within a workflow and make tasks based on how many Roles are within a group, for example as an end user I'm trying to select a group I'm trying to get in and based off the Roles, those should create individual tasks to be approved. so, if I choose a group and there's 3 roles within that group, 3 Tasks should be made automatically to be approved by someone. Same as if there was 5, there should be 5 so on and so forth,
Any help is appreciated, thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:02 AM
@HenryD , any luck with the approach, let us know the final conclusion.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 01:43 PM
Hello, sorry was out sick for a while getting back to this. rn i have a script in the workflow that looks like this:
var task = new GlideRecord("sc_task");
task.initialize();
task.request_item = current.sys_id;
task.short_description = 'Approver'
task.requested_for = 'requested_for';
task.approval ='requested';
task.insert();
How would i insert something in here or an example i can refer to? so that way i can make tasks based on how many roles are in the group, for example, if theyre are 5 roles, they should populated 5 tasks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 02:34 PM
Hi @HenryD, Let me know if we can talk and discussion, if possible then, inbox me zoom/googlemeet invite.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:32 PM
You can use RUNSCRIPT workflow activity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 11:53 AM
Hello, yes i figured it would be a runscript activity, what would an example script look like to get my solution? if you know thanks