I'm using ScriptRunner and I'm getting errors when the following script runs and it comes across a category that is blank. I would like to be able to add a check, so if category = null then do not run
Here's the code I have so far:
def issueProject = issue.getProjectObject();
def projectCategory = issueProject.getProjectCategory();
def categoryName = "";
if (categoryName) {
categoryName = projectCategory.getName();
}
return categoryName;
I tried replacing if statement with:
if (projectCategory.getName()) {
categoryName = projectCategory.getName();
}
But it throws back an error.