Hi,
I want to mark a field as required only when the DueDate has been modified. I have this behavior in the "serverside script" for the DueDate field.
However, currently the behavior is executed when anything is modified, not just the DueDate. I've tried elaborate ways to overcome this, but there has to be something simpler. What is the effect of defining the behaviour under a particular field? How can I make my code execute only when one particular field is changed?
See code:
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Category
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.ModifiedValue
def reasonBox = getFieldById("customfield_11100");
//clear reason box
reasonBox.setFormValue(null);
//require reason box so that user is forced to enter text
reasonBox.setRequired(true);