Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Change issue history to remove old custom field values.

Tarun Sapra
Community Champion
January 11, 2019

Hello All,

I am trying to remove the old values of an custom field from the issue history of the issue.

The API for the changeHistoryManager -

https://docs.atlassian.com/software/jira/docs/api/7.6.1/index.html?com/atlassian/jira/issue/changehistory/ChangeHistoryManager.html

has the method 

 removeAllChangeItems

but this will clear all the changeItems associated with an issue whereas I require that only specific custom field's value should be removed from issue history tab. This is required taking into the consideration privacy constraints around certain custom field data values.

Thus, the requirement is that when an issue is closed in the workflow then not only certain custom field values be cleared (easy part) but also their previous set values be removed from the issue history. Now, I don't want to get into DB queries etc thus is there a way to do it via the Jira APIs

1 answer

1 vote
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2019

Hello Tarun,

The functional design for the history is to ensure there is an audit trail on what has changed within the issue. Having the ability to change items with the audit trail would void the concept of an audit log. While there is a method to remove all items within the history of the issue, there is not a method to update, replace or add (outside of making a change to the issue).

This may also cause an issue if you have security teams which review the audit logs or you must meet compliancy requirements which require audit logs for work done. Being able to modify these outside of complete removal may void and compliancy which may be in place.

While you may access the database, you should avoid making changes to the application within the database directly. Doing so may also cause application issues and inconsistencies which may result in larger performance within the application.

While you may be able to edit this data, it is advised that you don't manipulate the history of the issues.

Database updates are not supported and can result in integrity issues. 
Please ensure to test this before applying to production.

Regards,
Stephen Sifers

Tarun Sapra
Community Champion
January 15, 2019

Hello @Stephen Sifers

Thanks for your insightful reply.

I completely agree with you and understand the compliance and the audit part.

Our requirement is such that certain custom fields having sensitive user data need to be removed after the completion of the workflow. Now, we can delete the custom field values but the issue history log still displays the original values. And since there seems to be no way in the APIs to selectively delete the history of certain custom fields thus the only option seems to be the below method from the changeHistoryManager

removeAllChangeItems

Now, I know that this method will remove all the issue history which again can be a problem with compliance and auditing. Thus, we might have a separate project with limited fields for our requirement which deals with sensitive customer data which needs deletion at the end of workflow. 

Let me know what you think of the approach or if you have some alternative approaches in mind. 

Thanks!

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 15, 2019

Hello again Tarun,

To ensure your sensitive data is protected, you may want to consider using an add-on which would allow you to hide said fields from the audit history. This would allow you to maintain compliance along with ensuring the sensitive data stays hidden but accessible.

Here is a preset search within the Atlassian Marketplace for field security add-ons. These add-ons would allow you to hide and secure the content of selected fields. These will also help to avoid the manual work of removing audit history entries which contain sensitive content.

This option of an add-on would most likely better suite other sensitive data needs that you may have as well. Along with possibly providing security to ensure only certain groups can see said sensitive content.

I hope this helps to provide a path forward with a more suitable solution to your needs.

Regards,
Stephen Sifers

Erik Mathijs
Contributor
September 26, 2022

Hi @Stephen Sifers ,

I am migrating our jira server to cloud.

Before starting migration there was a cleanup from unused custom fields though the UI.

When starting a migration with the latest jira cloud migration assitent (1.7.3), i see that the migration assistent complains about this removed custom fields.

WANR ... [c.a.j.m.e.core.issue.CloudChangeItemConverter] name_custom_field on Issue issuekey is not supported

Since the migration check takes more than 16 hours before I can start the effective migration, I have a timing issue.
The change history of non-existent custom fields will not be migrated, so I would like to ask you if it is possible to delete these records via a database query. This could greatly increase the migration process to cloud.

Kind regards,

Erik

Suggest an answer

Log in or Sign up to answer