Hi,
I have defined a scripted field "ID" which sets issuekey value to this field "ID" which works fine.
I am migrating project issues(CSV import) into jira where some of the issues has values of ID present already. But after import these values are overwritten with issuekey value.
I have set a IF condition to define only if (id==null) set issue key value to ID. But after project import the ID values are still overwriting.
I have below clarifications
1) If a field is scripted field, the project import values to that field will be overwritten always?
2) If yes then what is the way to define a condition that after project import my condition executes. The current script is in Scriprunner Scripted Fields.
where do i define script to allow project import values of ID without overwriting by Scripted Field condition?
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObject('customfield_10308')
def id_value=issue.getCustomFieldValue(cf)
//return id_value
if(id_value==null)
{
def key=issue.getKey()
def slash = key.toString()
def id1=slash.replaceAll("[-]",'')
return id1
}else{
return id_value
}