Calling workflow from script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 02:06 PM
Is there a way to call a workflow using script?I want the workflow to be only called from script and not by default when record is created for a table.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 02:33 PM
Aman, if by what you post you mean you want to attach a workflow to a particular record, you will have to do it using Workflow Script API.
You will see some basic usage examples on http://wiki.servicenow.com/index.php?title=Workflow_Script depending on your requirement, you will have to mix and match the scrips on that page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 02:36 PM
Thanks Abhiram.
I am using the script. But issue here is that the workflow also gets triggered when the record is inserted. is there a property at workflow level that we can set so that it can only be called from scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 02:38 PM
The workflow does not have to be triggered on creation of the record. You can set conditions on workflow and it will only be triggered once they are meet. That is usually good enough instead of using a script to attach the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2014 02:40 PM
I want to call the workflow only when assignment group changes and i dont see that option in the conditions.
i see there is a way to specify is , not in... and other options in condition but not the changes()