Skip to end of banner
Go to start of banner

Validator for component lead

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »



string [] comp = component;
boolean pass = false;

string errorMsg = "You can only have a single component assigned to this issue";

if(arraySize(comp) > 1) {
    return false, "error", errorMsg;
}

errorMsg = "Only the component lead can perform this action";

for(string c in comp) {
    if(getProjectComponentLead(project, c) == currentUser()) {
        pass = true;
    }
}

if(!pass) {
    return false, "error", errorMsg;
}


  • No labels