Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Delete / clear individual rows of change history from JIRA issues

Shaun Smith November 1, 2016

Hi,

Following on from https://answers.atlassian.com/questions/304915.

I would like to know if it's possible to clear individual rows from JIRA's issue change history.

Unfortunately the easiest solution  - updating the issue, cloning it then deleting the original - is the least desired end user option, closely followed by - stopping jira, removing bits from changegroup / changeitem, then restarting - as the IT support team are not supposed to see the data in question and I am a front end administrator only.

I've used the code supplied in the other question to run in Scriptrunner's script console, and I can inspect the element of the row of my issue in question to get the change ID e.g.

<div class="action-details" id="changehistorydetails_12345">

Is there something I can replace ".removeAllChangeItems" with in the below script to pick up the change ID and remove it's details only?

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
Issue issue = issueManager.getIssueObject("ABC-1234")
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
changeHistoryManager.removeAllChangeItems(issue)
return issue.toString ()

I am using JIRA 7.1.8 if that's any help.

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
thalesc March 12, 2019

Long shot here after more than 2 years, have you found a way to do this? I am looking for the same thing :)

Shaun Smith May 3, 2019

I'm sorry to say, no I never did! :(

0 votes
Diego Godoy Poce May 3, 2019

Same here...

Nici Emmel May 10, 2019

Hello Diego,

there is a plugin on the Atlassian Marketplace which could help you. It is called "Issue History Item Remover".

Diego Godoy Poce May 10, 2019

Hi Nici,

Thanks for your answer, but I need to remove history items as a part of code.

Thank you anyway :)

0 votes
Royce Wong
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.
February 7, 2017

Same here, need to delete individual history entry of a ticket.

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