- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 12:29 PM
Hi,
When I create and close sc task after a minute. The catalog task status changes from "Complete" to "In-Complete". How do I debug why the state is getting "In-Complete" status at the end?
StateClosed IncompletewasClosed Complete
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 12:53 PM
Hi,
Can you share the script from run script activity where you are closing the task? Make sure to use the value of closed complete in the script.
Also, connect your catalog task activity to the end activity. That might also be leading it to incomplete status.
Thanks,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 06:20 PM
Thanks for your response. I made change to workflow as per your suggestion but it didn't worked.
var grTask = new GlideRecord('sc_task');
grTask.addQuery('request_item',current.sys_id); // request_item is RITM reference column in sc_talk table;
gs.log('request_item='+current.sys_id);
grTask.addQuery('active' , true); // check if task is still open
grTask.query(); //execute the query
// check if result set has some task record
if(grTask.next()){
grTask.state = '3' ; // 3 is choice value for close complete
grTask.comments ='Task closed by 5minute timer';
grTask.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2020 09:30 AM
Hi,
Can you try this once?
var grTask = new GlideRecord('sc_task');
grTask.addQuery('request_item',current.sys_id); // request_item is RITM reference column in sc_talk table;
gs.log('request_item='+current.sys_id);
grTask.addQuery('active' , true); // check if task is still open
grTask.query(); //execute the query
// check if result set has some task record
if(grTask.next()){
grTask.state = '3' ; // 3 is choice value for close complete
grTask.comments ='Task closed by 5minute timer';
grTask.setWorkflow(false);
grTask.update();
}
Thanks & Regards,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2020 10:04 AM
Thanks Sharjeel. I cannot use the setWorkflow in my workflow. Any other suggestions, please? I'm just trying create and close a task.