Please tell me what is wrong with this script? It is returning NULL.
Requirement: Need to update the value of a custom field from NULL to the value specified in the script.
----------------------------------------------------------------------------------------------------------
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.fields.CustomField;
def fieldid = 14601L //field id; currently having null value
def dbValue = "8.0.8" //New value to be assigned to the custom field
def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("TIK-3039"); //issue in JIRA
MutableIssue myIssue = issue;
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(fieldid); //Identification of Custom Field Object
myIssue.setCustomFieldValue(customField,dbValue); //updating the value from "Null" to the value declared above "dbValue"
----------------------------------------------------------------------------------------------------------
Best regards,
Nishant