Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,344
Community Members
 
Community Events
165
Community Groups

how to delete entries in Emails tab of an issue

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

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

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you