Hi community! Recently, I've started to explore scriptrunner for DC and I am wondering how to read the values of a custom field. Here's the code:
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.component.ComponentAccessor;
import com.altassian.jira.issue.fields.CustomField;
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def customField = customFieldManager.getCustomFieldObject("customfield_10201");
Hello @Nikola Perisic ,
As I see the question that you asked, you need this code for DC, you can use the code block below.
def customField = ComponentAccessor.customFieldManager.getCustomFieldObject(fieldToCopyId)
def linkedIssueCustomFieldValue = parentIssue.getCustomFieldValue(customField)
Also you chose the deployment type Cloud version, you can use this link for the cloud.
Please let me know if this helps,
Umut
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.