I have a few field in my issue when it is edited. I want to get the values of the fields and from the answer fields, only the values of selected one when the update button is pressed. I have currently following script which produces a huge json and contains a lot of irrelevant information. Could someone help me with this? thanks
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.fields.config.FieldConfig
import com.atlassian.jira.issue.context.IssueContextImpl
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.customfields.option.Options
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
import java.sql.Timestamp
import com.atlassian.jira.config.util.JiraHome
import org.apache.commons.lang3.StringEscapeUtils
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.customfields.option.Option
import groovy.json.JsonSlurper
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def issueManager = ComponentAccessor.issueManager
def issue_obj = issueManager.getIssueObject("TM-197") // the tm_confirmation issue number, replace with the real id
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("customfield_12345") //Custom Field Value - object confirmation, replace with the real id
def cFieldValue = issue_obj.getCustomFieldValue(cField)
cFieldValue // Custom Field Json
In the below picutre, i have questions and answers. I want to get the value of the question and selected answer when the update button is pressed.. I am totally new to Jira so facing a number of issues. Is there any guide to learn the groovy script which I can run in the script runner console? thanks
any help would be really appreciated. thanks
