Problem:
I cannot get a customField value from an Epic to be inherited when I Create a new issue type that is linked to that Epic.
Tried being the operative word.
import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.issue.CustomFieldManager; import com.atlassian.jira.issue.fields.CustomField; import com.atlassian.jira.issue.Issue; CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); if (issue.getIssueTypeObject().getName() == "Story" ) { CustomField epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link'); Issue epic = issue.getCustomFieldValue(epicLink); if(epic) { issue.setActivityType(epic.getActivityType()); } }
Please help. Will be much appreciated!
Getting these errors with Script Runner:
avax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script10.groovy: 8: unable to resolve class CustomFieldManager @ line 8, column 20. CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); ^ Script10.groovy: 11: unable to resolve class CustomField @ line 11, column 17. CustomField epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link'); ^ Script10.groovy: 12: unable to resolve class Issue @ line 12, column 11. Issue epic = issue.getCustomFieldValue(epicLink); ^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.