Calling javascript as external resources-camunda

I am trying to take decision by calling javascript as external resources on condition type Attribute.
and its routing in one direction either its true or false. below is my javascript code
var getexistingClient = execution.getVariable(“existingClient”);
var setexistingClient = execution.setVariable(“existingClient”, existingClient);

validation();
function validation(){
if (getexistingClient.equals(“Y”)) {

return true;

} else {

return false;
}

}

Why don’t you test variable ?

${existingClient == ‘Y’}

Also, what is your question?

${existingClient == ‘Y’}
this is working fine but I want to do the validation from external resources as because I have many other variables on which i need to do validation so and variables can be changed.
so I need to do validation from external resources.

Hi @abhi1o3,
I’m not javaScript expert but as far I know latest script line is treated as result and should return boolean value e.g. validation();

can you tell me Rest Api for getting candidate Group name?

Sorry, but I do not understand your question. How this reflect to initial topic?
Task’s candidate group (and more) can be obtained from get task operation

ya this is different from above topic but i need to get the candidate group associated with user task using Rest Api

Then you should close this topic and open new one.