- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 03:42 AM
Hi There,
i've modified the workflow recently which closing workflow by itself. But old requested items still in execution stage.Is there a way to set workflow from executing to complete manually the old requested item which are in complete state.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 04:06 AM
Hi Sarasaamani,
Using background Script you can close the workflow stage.
var gr = new GlideRecord("sc_req_item");
gr.addQuery("stage","executing");
gr.query();
gs.getRowCount("Records:" +gr);
if(gr.next()){
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.stage = "complete";
gr.update();
}
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 03:49 AM
See if this links helps you.
Set current workflow stage to compelte
Can you set a workflow stage in a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 03:55 AM
Based on your point, you want to set the old request item stage need to complete. Modified workflow will not execute on old request item.
fro that You need write a fix script or background script ,glide record on request item table and query the those old requests and set the stage value to complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 04:06 AM
Hi Sarasaamani,
Using background Script you can close the workflow stage.
var gr = new GlideRecord("sc_req_item");
gr.addQuery("stage","executing");
gr.query();
gs.getRowCount("Records:" +gr);
if(gr.next()){
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.stage = "complete";
gr.update();
}
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 10:00 PM
Hi Pavan,
i tried your script in scheduled job and its not working:(