Programming Change Logs
Tracking changes to an issue is very important. JIRA stores all the changes that are done on an issue as change logs along with the information of who made the change and when. Sometimes, when we do custom development, we will have to update the Change History by ourselves when something changes on the issue by our plugin.
Change Histories are logged as change groups which are a group of one or more change items made by a user at any one time. Each change item will be a change made on any single field.
In this recipe, we will see how to add change logs on an issue using the JIRA API.
How to do it...
Each change item in JIRA is created as a ChangeItemBean
. ChangeItemBean
can be of two different types—one for system fields where the field type is ChangeItemBean.STATIC_FIELD
and another for custom fields where the field type is ChangeItemBean.CUSTOM_FIELD
.
The following are the steps to add a Change History.
Create a
ChangeItemBean
for the change that needs to be recorded...