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 ourselves when there are some changes on the issue by our plugin.
Change histories are logged as change groups, which are groups 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
. A 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...