Forums

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

How to Hide comment of any specific user from JIRA comment tab

DILEEP KUMAR February 10, 2019

Hi, 

I want to hide hide/delete comment of any specific user from JIRA comment tab.

Please suggest any solution for this.

 

Thanks,

Dileep Kumar

2 answers

1 accepted

1 vote
Answer accepted
Ismael Jimoh
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 10, 2019

With regards the above, the first question is why because if you intend yo delete it, I believe it would be better to just take away the permission to add comments entirely for the said user.

You can change project permission scheme for my suggestion.

If you want to hide it, then get scriptrunner add-on and in your script, check who the user is and then restrict the comment to a specific group or role(Jira has this built in but I cannot remember offhand if it’s role).

Once again personally as you are thinking of deleting the content my advice is take away the permission to add comments.

DILEEP KUMAR February 11, 2019

Hi Ismael,

Thanks for your quick response !! 

I want to delete/hide comment because this comment is coming form web-hook. Whenever any user is doing commit it is being added to respective JIRA ticket.

Here the intention is to have (as below mentioned):-    

a). Copy & hide the git-user comments for JIRA issue comment section.

b). Create a tab Git Commit in JIRA Activity Panel.

c). Paste the git-user comments in newly created Git Commit tab.

 

For this reason i am looking for JavaScript to hide and move the specific user comment to git comment tab (I am creating this custom tab using plugin).

I have scriptrunner add-on and need to write script, which will check who the user is and then restrict the comment to a specific group or role.

 

Please suggest you thought as well.

 

Regards,

Dileep Kumar

Ismael Jimoh
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 11, 2019

I cannot recommend JavaScript in JIRA and I believe this has mostly been disabled.

Now with your request, if I understand correctly, you still want the comments but just want it not to be shown in the comments section.

If this is the case, then you would more or else be customizing JIRA and I'll suggest looking at script runner add-on to see if it is of any help.

- As mentioned, in my last reply, restricting the comment to a group or role is another option, just make sure that the github user is in the said group and at least you or another admin or person using the git has access to it so you can verify from time to time that this is working as you expect it to.

Else, you would need to customize JIRA itself from the source code to get your request working.

DILEEP KUMAR February 12, 2019

Thanks @Ismael Jimoh for quick response !! 

I will implement the suggested solution and check if it works. 

 

Regards,

Dileep Kumar

Vaibhav Wadate
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 28, 2021

hey @DILEEP KUMAR  how to implement solution for hide comment?

0 votes
Hubert Sękowski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 4, 2019

I created Script Listener script attached to Issue Commented:

import com.atlassian.jira.component.ComponentAccessor

if ("[user key]" == event.comment.authorKey){
    event.comment.setRoleLevelId([role ID])
    boolean dispatchEvent = false
    ComponentAccessor.commentManager.update(event.comment, false)
}

It works like a charm :)

Suggest an answer

Log in or Sign up to answer