The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have multiple field validations that have to be done and I thought I'd just put them in a loop with an array of customfield ids. But the isNull field doesn't seem to accepting my field substitution when building the field name to use as a parameter, it's not detecting null fields. Is what I'm doing below possible?
string [] fieldids = {"16601"};
for (string fieldid in fieldids) {
if(isNull("customfield_"+fieldid)) {
return false,"Field " + getCustomFieldNameById(fieldid) + " must be filled in";
}
}
Thanks,
Jay
Solved my own question. I tried using variable substitution and it worked just fine!
string [] fieldids = {"16601","16805","16810"};
string customfield;
for (string fieldid in fieldids) {
customfield="customfield_"+fieldid;
if(isNull(%customfield%)) {
return false,"Field " + getCustomFieldNameById(fieldid) + " must be filled in";
}
}
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.