The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

how to delete entries in Emails tab of an issue

Sandeep Upadhya
July 19, 2019

hi,

   I need to delete entries in History and Emails tab (next to Activity) of an issue. I have a script which worked for History

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)

 

But the script below dint work for Emails. It is returning 0 count of rows deleted - 

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
Issue issue = issueManager.getIssueObject("ABC-1234")
def changeMailThreadManager = ComponentAccessor.getMailThreadManager()
Long issueid1 = 125481L
changeMailThreadManager.removeAssociatedEntries(issueid1)

what is wrong in above script and why it is not deleting email entries in Emails tab of issue?

 

regards,

Sandeep Upadhya

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
srikanth Gutlapally
June 7, 2022

I have the same issue. Did you find a solution?