Jira issue history import.

ashwinirghure November 3, 2011

HI ALL

I have some issues in one database.

I have imported that issue in to jira using plugin.But history of that issues is not imported in to jira.

I want to import history of that all issues into jira.

As i understood by reading JIRA Database schema there are two tables for history

1)Change group Table

2)Change Item Table

so i will pulll data from my database by using query.

But how i can insert this data into JIRA by using JIRA API.

Please help me.

Thanks in advance

Ashwini G.

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
ashwinirghure July 22, 2013

It is also resolved.

I used external change item and external change group to import the history.

Thanks for help :)

0 votes
Wojciech Seliga
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2011

Hi, I would take a closer look at the following classes/methods in JIRA source code:

  • com.atlassian.jira.issue.util.DefaultIssueChangeHolder
  • com.atlassian.jira.issue.history.ChangeItemBean
  • com.atlassian.jira.issue.history.ChangeLogUtils
  • com.atlassian.jira.issue.managers.DefaultIssueManager#updateIssue
  • com.atlassian.jira.issue.managers.DefaultIssueManager#doUpdate

I think though that you may have problems with importing the original timestamp for given change.

ashwinirghure November 7, 2011

Hello Wojciech Seliga

i have write following code in externalUtils.java.

This is for creating change group values.

pls let me know where i am wrong.

public GenericValue createChangeGroup(User author,Collection<ChangeItemBean> incomingChangeItems,final Issue issue)
throws GenericEntityException {
log.debug("in create change gropu********");
IssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();
ChangeHistoryManager changeHistoryManager = (ChangeHistoryManager)ComponentManager.getComponentInstanceOfType(ChangeHistoryManager.class);
if (incomingChangeItems == null || incomingChangeItems.size() == 0)
{
return null;
}
final ArrayList<ChangeItemBean> changeItems = new ArrayList<ChangeItemBean>(incomingChangeItems);
for (ChangeItemBean cib : changeItems) {
ChangeItemBean changeItem = new ChangeItemBean(cib.getFieldType(),cib.getField(),cib.getFrom(),cib.getFromString(),cib.getTo(),cib.getToString());
changeItems.add(changeItem);
issueChangeHolder.setChangeItems(changeItems);
}
GenericValue changeGroup = ChangeLogUtils.createChangeGroup(author, issue.getGenericValue(), issue.getGenericValue(), issueChangeHolder.getChangeItems(), true);


return changeGroup;
}

ashwinirghure November 9, 2011

HI

Can you tell me in jira database schema the reletionship between changeitem table and changegroup table.

Means i want to know which thing first insert in to Database first change item is created or change group is created in database.

0 votes
ashwinirghure November 3, 2011

YES .

Thanks for u r reply

0 votes
Wojciech Seliga
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2011

would you like to import the history of each issue in terms of when and who did the transitions and/or changed the fields?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events