- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 12:50 AM
hi team ,
i want to generate the approvals in the approvers tab in the change form after
completion of all the four task as given below in the screen shot.
here i dont want to keep the condition in the task like first task completed then second task should open.
here my all task going to generate together and here i want once all the task completed then approval should generate
plz help me
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 02:22 AM
1. In the workflow add a workflow condition activity that will wait till all tasks related to that change completed. and connect output of that activity to approval user/approval group activity.
Script inside the wait for condition activity should be like,
// Set the variable 'answer' to true or false to indicate if the condition has been met or not.
//answer = true;
var gr_tsk = new GlideRecord("change_task");
gr_tsk.addQuery('change_request', current.sys_id);
gr_tsk.addQuery('state','!=', 24);
gr_tsk.addQuery('state','!=', 3);
gr_tsk.query();
if (gr_tsk.next()) {
answer = false;
} else {
answer = true;
}
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 01:18 AM
Hi Kamlesh,
You need to check the workflow attached to this change request and you will have to tweak it.
Follow below details.
http://wiki.servicenow.com/index.php?title=Workflow_Concepts
Hope this helps you.
Regards,
Atul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 01:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 02:42 AM
i followed this step but here i want if both task is completed then only it should go for approval.
but here without completing this both task it is going to approval requested
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 02:22 AM
1. In the workflow add a workflow condition activity that will wait till all tasks related to that change completed. and connect output of that activity to approval user/approval group activity.
Script inside the wait for condition activity should be like,
// Set the variable 'answer' to true or false to indicate if the condition has been met or not.
//answer = true;
var gr_tsk = new GlideRecord("change_task");
gr_tsk.addQuery('change_request', current.sys_id);
gr_tsk.addQuery('state','!=', 24);
gr_tsk.addQuery('state','!=', 3);
gr_tsk.query();
if (gr_tsk.next()) {
answer = false;
} else {
answer = true;
}
Thanks,
Mihir