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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Ismael Jimoh for quick response !!
I will implement the suggested solution and check if it works.
Regards,
Dileep Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hey @DILEEP KUMAR how to implement solution for hide comment?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.