How to start a workflow from script include using UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2016 06:28 AM
Hi All
We have a requirement to trigger workflow using UI action. We are able to call script include from UI action but not able to call workflow.
Thanks in advance,
Regards,
Animesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2017 07:34 AM
Oops. Force of habit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2017 07:38 AM
lol, its ok reply to the person that created this Thread so they can mark as correct. For all of us, . I would say the answer is in here somewhere as we went through the best and safe way to start a workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2018 08:10 AM
I'm writing a scoped application, in that I have UI action button .
When we click on theat button, state field value(current in Inprogres) should be changed to Submitted by triggering the workflow.
Can any one please help me.
Thanks,
Raj.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2018 11:36 PM
Hi,
Use below code to trigger workflow.
////where current is a task record with a workflow context
var w = new Workflow();
var context = w.startFlow(id, current, current.operation(), getVars());
Also, you can go through below link to understand
https://developer.servicenow.com/app.do#!/api_doc?v=london&id=r_WF-startFlow_String_GR_S_A