I want to copy FixVersion/s field to custom field Fix Version (Single version picker).
I assisted by this post and rewrite the script mentioned in here: https://community.atlassian.com/t5/Jira-questions/Copy-Affects-Version-and-Fix-Version-values-to-new-Version/qaq-p/127058 (Jeremy code).
when i running this code on the script console in script runner i get the next error:
2018-04-17 12:53:56,645 WARN [common.UserScriptEndpoint]: Script console script failed: java.lang.NullPointerException: Cannot invoke method getId() on null object at Script12.run(Script12.groovy:21
what am I missing here?
This is the code:
IssueManager issueManager = ComponentAccessor.getIssueManager();
ProjectManager projectManager = ComponentAccessor.getProjectManager();
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField nvcf = customFieldManager.getCustomFieldObjectByName("Fix Version"); // Fix Version Custom Field
Project project = projectManager.getProjectByCurrentKey("PROC");
Collection<Long> projectIssueIds = issueManager.getIssueIdsForProject(project.getId());
Issue issue = issueManager.getIssueObject(it);
Object fixVersions = issue.getFixVersions();
Object newFieldVersions = issue.getCustomFieldValue(nvcf);
issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), issue, EventDispatchOption.ISSUE_UPDATED, false);
Missing deadlines is one of the biggest problems every team lead wants to avoid when dealing with managed services. When the customer contracts your company to help with IT services it is expected th...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events