IF Condition in workflow always returns yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 04:21 AM
I am try to write a IF condition advanced script that will be yes if some locations but no if it is the rest. This will allow me to assign it to the correct assignment group in the workflow. The location variable is a reference field so im not sure if that my issue or not. Please tell me why my script keeps returning yes every time. See script below.
function ifScript() {
if (current.variables.cmn_location != 'Olofstrom' || current.variables.cmn_location != 'Bielsko-Biala' || current.variables.cmn_location != 'Gothenburg' || current.variables.cmn_location != 'Forsheda')
return 'yes';
else
return 'no';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2015 10:55 AM
Chris,
I think below code works for you
- function ifScript() {
- if (current.variables.location.getDisplayValue() != 'Olofstrom' && current.variables.location.getDisplayValue() != 'Bielsko-Biala' && current.variables.location.getDisplayValue() != 'Gothenburg' && current.variables.location.getDisplayValue() != 'Forsheda')
return 'no';
- else
return 'yes';
Thanks,
Sunil Safare

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2015 03:13 PM
Chris,
Are you on Fuji? I'm having the same issue on the latest patch of Fuji, but I was able to successfully create the scripts in Eureka without issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2015 05:51 AM
Susan,
I put the script into the task creation and it worked for me in Fuji.