Forums

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

Scriptrunner - Removing all comments from a specific user without sending ticket update notification

Michael
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.
August 7, 2023

Hi everyone,

I'm trying to remove all the comments within our Jira instance from "testUser1" while preventing Jira from sending out the normal "ticket update notification" email.

Is there a way to do this? I've been able to find all the comments the user submitted via JQL, but I'm assuming there would need to be a script run within the Script Console.

Any help would be greatly appreciated!

Thanks,

Mike

2 answers

1 vote
Nic Brough -Adaptavist-
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.
August 7, 2023

You can do this without notifications if you get a bit clever with custom events.

If you create a new custom event (call it something obvious like "do not use me"), and do not set it to do anything in notification schemes, you can use the CommentService.deleteComment and fire that event - no notifications will be sent.

Michael
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.
August 8, 2023

Thanks @Nic Brough -Adaptavist-

That should work perfectly, but how would I setup that specific event for a specific user? (In this case "testUser1")

Thanks,

Mike

Nic Brough -Adaptavist-
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.
August 8, 2023

Events are things that happen in Jira, they don't have anything to do with users.

0 votes
Joe Pitt
Community Champion
August 7, 2023

Do it on weekends or other time when people aren't using Jira. Change the notification scheme with one that doesn't send notifications for comments, edit, or updates. Run the script and change the notification scheme back. 

Michael
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.
August 7, 2023

Hi @Joe Pitt

I'm currently looking for a script that would do both at the same time so we wouldn't have to change the notification scheme.

If we have to change the notification scheme that would be ok - but we would still need to find a script that would remove all comments.

Do you have any suggestions where I would be able to find one?

Thanks,

Mike

Joe Pitt
Community Champion
August 7, 2023

No. I don't use scripting. I guess I misread and thought you had script to find and delete them, but didn't want notifications. 

Suggest an answer

Log in or Sign up to answer