Trigger workflow using a condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2016 03:21 AM
Hi,
I want to trigger a workflow when an incident is created. I've tried to use if condition in the workflow as follows:
function ifScript() {
if (previous.incident_state ==0 && current.incident_state==1) {
return 'yes';
}
return 'no';
}
Instead of having an if condition, I need to trigger the workflow when this condition is met.
Do I need to have a business rule to do such, else do we have any other option. Kindly suggest me the best approach to do it
Thank You.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2016 03:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2016 03:42 AM
previous will not be available when incident is inserted. Below should work.
function ifScript() {
if(current.incident_state==1) {
return 'yes';
}
return 'no';
}