It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira 7 -> 8 componentmanager problem

Hello All,

Please help me, we've just upgraded from Jira 7 to Jira 8.

1 of our scripts failed. ComponentManager no longer usable. Could you help me how can I revive the script?

ChangeHistoryManager changeHistoryManager = (ChangeHistoryManager)ComponentManager.getComponentInstanceOfType(ChangeHistoryManager.class);

The error message: [Static type checking] - The variable [ComponentManager] is undeclared.


Thank you!



The full script

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.changehistory.ChangeHistory;
import com.atlassian.jira.issue.changehistory.ChangeHistoryManager;
import com.atlassian.jira.issue.status.Status;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.ofbiz.core.entity.GenericValue;

Logger log = LoggerFactory.getLogger("Previous Status Field");

log.debug("Issue " + issue.getKey());
ChangeHistoryManager changeHistoryManager = (ChangeHistoryManager)ComponentManager.getComponentInstanceOfType(ChangeHistoryManager.class);
List changeHistory = changeHistoryManager.getChangeHistories(issue);
for (int i = changeHistory.size() - 1; i >= 0; i--)
ChangeHistory changeHistoryItem = (ChangeHistory)changeHistory.get(i);

List changeItemBeans = changeHistoryItem.getChangeItems();
Iterator it = changeItemBeans.iterator();
while (it.hasNext())
GenericValue change = (GenericValue);
String changedField = change.getString("field");
if (changedField.equalsIgnoreCase("status"))
String oldStatus = change.getString("oldstring");
return oldStatus;
return null;

1 answer


use ComponentAccessor instead

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

229 views 1 2
Join discussion

Community Events

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

Events near you