I'm trying to add some conditions to an asset postfunction.
Is there any special way to do it?
Whenever ill add some groovy conditions it stops working.
There are some examples listed on the page liked below the input field: Groovy script examples | Jira Service Management Data Center 5.17 | Atlassian Documentation
Your groovy code should just return true or false, depending on whether the post function should run.
Example taken from the linked page:
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;
def value = issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObject(10000)); // Change ID to the correct one
/* If an insight custom field has an object called "Microsoft" it will fail */
if (value != null && "Microsoft".equals(value[0].getName())) {
return false;
}
return true;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.