I am working on a plugin and trying to get a list of transitions for an issue.
I was thinking to look through the change history for changes to status using the title method in code below
List<Issue> issues = new ArrayList();
issues.add(currentIssue);
List<String> fields = new ArrayList();
fields.add("status");
List<ChangeHistory> transHist = chgManager.getChangeItemsWithFieldsForIssues(issues, fields);
for (ChangeHistory change : transHist) {
UserHistoryEvent event = new UserHistoryEvent(change.getAuthorDisplayName(), change.getTimePerformed(),
"Transition", change.getId());
List<ChangeItemBean> cha = change.getChangeItemBeans();
events.add(event);
}
I am getting all change histories returned (3 in test) although only one amends status.
When I look for change items in debug the ChangeItemBean list is empty.
Am I missing a trick? Is there an easier method to get a list of issue transitions?
Tom
Hello @Tom Lister
History doesn't contain information about transitions. Only status changes.
I made little research and it seems you cannot do it with Java API.
I agree, there is no managed API methods that I can find. I am assuming that the status is only normally changed by workflow and can find those events in the history. Although they can be mixed in with other transition form changes as well.
in the Issue Activity tab you can see events reported as transitions
e.g.
I think I'll need to download the JIRA source and see where that comes from.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As an update, what I am seeing in debug is that I will get all the change histories for an issue, but if I look through the ChangeItem list, only the status change value is ever returned.
My comment about no items returned at all must have been fat fingers somewhere.
However this does seem to mean I have to iterate through all histories checking for items.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.