title: How do I set a radio button value based on a condition of several other radio button selections?
body: <p>Just need a little direction in finishing my script, I need to gather the values of several radio button fields and perform an if/then condition to determine the default radio button value of one other. This is what I have so far, is this the correct approach? What am I missing? This is a custom field script using Groovy in ScriptRunner.</p>
  
  <pre><code>import com.atlassian.jira.issue.IssueManager
  import com.atlassian.jira.issue.Issue;
  import com.atlassian.jira.issue.fields.CustomField;
  import com.atlassian.jira.issue.IssueManager;
  import com.atlassian.jira.issue.CustomFieldManager;
  import com.atlassian.jira.component.ComponentAccessor;
  import com.atlassian.jira.issue.MutableIssue;
  
  //managers
  def customFieldManager = ComponentAccessor.getCustomFieldManager()
  IssueManager issueManager = ComponentAccessor.getIssueManager();
  
  //gather the fields needed
  def field1 = CustomFieldManager.getCustomFieldObjectByName("Field 1")
  def field2 = CustomFieldManager.getCustomFieldObjectByName("Field 2")
  
  //gather the values of the fields
  def field1Value = issue.getCustomFieldValue(Field1).getValue()
  def field2Value = issue.getCustomFieldValue(Field2).getValue()
  if (field1Value == "Agree" &amp;&amp; field2Value == "Agree"){
      def field3 = customFieldManager.getCustomFieldObjectByName("Field 3")
      issue.setCustomFieldValue(field3, "Agree")
  } else {
      issue.setCustomFieldValue(field3, "Disagree")
  }
  </code></pre>