- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 05:36 AM
I want to develop a workflow such a way that i want my workflow to wait till one task is Resolved/Closed complete and then move to next task.
I'm trying to achieve this with a "wait for condition" since i also want to check the state = Resolved.
Also what happens is when i Resolve one task it "Resolve" my RITM as well it did not wait for another task to get generated but as per i requirement i want my RITM not to get resolved / closed until all my tasks are resolved / complete
I'm not sure whether the issue is clear let me know if you require more details
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 07:43 AM
yes I know that, What you have mentioned in the question was "I want to develop a workflow such a way that i want my workflow to wait till one task is Resolved/Closed complete". So this can do that trick if closed complete is fine.
If you want to query only based on the resolved state then wait for condition should be used.
Slightly modify your code like,
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.sys_id);
gr.query();
gs.log('TASK1 count:'+gr.getRowCount());
while (gr.next()) {
gs.log('TASK1 state:'+gr.state);
if(gr.state != 6)
{
gs.log('TASK1 inside if');
answer = true;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 09:29 AM
Hi Ajai,
I also want to set the delivery date accordingly.
For eg : If i'm resolving Catalog task 1 on 5/30
I want to add 2 more days to the next catalog task delivery date which got generated.
If possible i would like to check the scheduled dates also .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 10:59 PM
These links will help you for that,
Modify a GlideDateTime Field Value - ServiceNow Wiki
GlideSystem Date and Time Functions - ServiceNow Wiki