attaching workflow for ritm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2017 07:22 AM
Hi ,
I had requirement : To reopen the request and a new ritm should be created and new task created.
So I did ui action Reopen. It is reopen request and creating ritm but the workflow is not attched to new ritm.
Can any one help me how to attach same workflow of previous ritm's . So that new ritm will have task and approvals ....
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2017 07:54 AM
Hello Bala,
Can you provide the current script that you are running. ServiceNow has the capability to create an order via script. You will have to do this using the GlideappRequestNew object rather than the GlideRecord object, since GlideRecords will just insert the record on the table without associated functionality.
new GlideappRequestNew();
how to create request item from script
Here is another similar question on the community. Unfortunately the wiki was archived, so the main link will not work and I have yet to find the documentation on the doc site for this functionality, but hopefully it is still available on the doc site.
Best,
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2017 07:20 AM
I had created new ritm and triggered workflow ...but variables are not populating on new ritm. can you help in this .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2017 10:36 AM
Hi Andrew,
//Reopen the request
Current script
current.state = "1";
current.request_state = "in_process";
current.comments = "Request Reopened";
current.stage = "requested";
current.update();
//Reopen the item record & restart the workflow.
var i = new GlideRecord('sc_req_item');
i.addQuery('request', current.sys_id);
i.query();
while (i.next()) {
var gr=new GlideRecord('sc_req_item');
gr.initialize();
gr.request=i.request;
gr.u_category=i.u_category;
gr.u_subcategory=i.u_subcategory;
gr.u_item=i.u_item;
gr.watch_list=i.watch_list;
gr.opened_by=i.opened_by;
gr.contact_type = i.contact_type;
gr.assignment_group = i.assignment_group;
gr.assigned_to=i.assigned_to;
gr.short_description=i.short_description;
gr.wf_activity = i.wf_activity;
gr.stage="waiting_for_approval";
gr.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2017 10:55 AM
Hi ,
can you tell me what i need to update.