Is it possible to disable comments for a particular issue type?

Eban Tomlinson June 3, 2015

I wish to disable the comments for a particular issue type. In effect, for a given issue type we are hoping to fully disable commenting, either at transition time or on the view/edit screens.

I can't disable it via Field Configuration as there is no option to, and Screens never have comments showing up.

I know I can do it via permissions on workflow transitions, but I'm looking to disable it entirely.

Does anyone know of a workaround for this? 

9 answers

1 accepted

2 votes
Answer accepted
Stas June 3, 2015

Hi!

Try Script runner plugin

There tou can add a behavior for fields in projects/issue types/other conditions

Then just deny writing comments for your issue type

Cheers!

Eban Tomlinson June 3, 2015

I'm looking into this approach. I presume you're talking about a Field Validator. Unfortunately it appears to not be working in ScriptRunner. I've got a support call logged with them.

William Crighton _CCC_
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.
June 3, 2015

@Eban Tomlinson No, he's referring to the Behaviors portion of the ScriptRunner plugin. The problem with using a Validator is that it'll only be used (to...uh...validate) as part of a workflow transition - it validates the data entered by the user on the transition form. No use for other places you can edit. I'm looking into a routine I wrote a while back that I used to control field changes via a Script Listener but it's taking a bit to find the correct part. -wc

Eban Tomlinson June 3, 2015

Ahhh. Okay, I've got it now. I'm going down this path, and I'll update when/if it works! Thanks William!

Eban Tomlinson June 3, 2015

This worked like a charm! Thanks Stas!

Eban Tomlinson June 3, 2015

And William!

Jonalyn Haloot May 11, 2018

Hi Eban,

Can I please have your update on how did you fully "disable comments" for particular issue type/s in any transition and edit screen using Behaviour.

I'm having the same question, in our case we need to disable or hide the "Comment"/"Comments" tab button from a particular sub-task/issue activity panel.

Thank you in advance.

anthony_butler November 13, 2018

@Eban Tomlinson could you please provide a step by step guide for what you did to achieve this? I've been trying with the behaviours within ScriptRunner and I can't seem to make it work. I'd like to able to disable comments for all barring a select group of people. Any help you can give would be massively appreciated.

3 votes
Pedro Cora
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 3, 2015

My suggestion would be to add the workflow property to disallow comments on all transitions. But I know that it's kinda cumbersome..

Eban Tomlinson June 3, 2015

That wouldn't disallow comments on the view/edit screens though, which is also part of the request :(

2 votes
William Crighton _CCC_
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.
June 3, 2015

@Eban Tomlinson

adding another answer - I think this is almost there or is there for non-service-desk enabled projects.

If you look at the screenshot you see the behavior I created that removed the comment field from every place but the browse issue form - but I think that's because of service desk.

It was extremely impressive to see it work w/o but 3 lines of code which came from the in-page doc. Friggin Jamie man, his plugin totally rocks

screenShotOfBehaviorToRemoveComments.png

1 vote
William Crighton _CCC_
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.
June 3, 2015

I would see if you can hide the comment field in a field config and then setup a field config scheme assiging that field config to the 'commentless' issue type you want to use. I've never done that, and not sure if it'll do what you want, but in theory it should work, maybe.

Sorry for my lack of confidence here, trying to leave answers space but it keeps pulling me back in.....

-wc

Eban Tomlinson June 3, 2015

No worries, I appreciate the response. In this case there is no option to disable comments via Field Configs or Schemes. It was one of the first places I went because like you it seemed like it should be possible. Sadly, it's not :(

William Crighton _CCC_
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.
June 3, 2015

Ok, another thought - throw a field on the issue type create/edit/view screens saying any comment added will be removed and then write a groovy listener (as with other suggestions, utilize Jamie Echlin's ScriptRunner plugin) that looks at the issue updates in the event object and removes any comment updates. I think you could just listen for 'issue commented' and strip it out there but you might need to listen for every event type. -wc

Eban Tomlinson June 3, 2015

A good thought, but untenable for our current install I'm afraid as our users would just ignore it and do it anyways. I'll likely tackle this problem with training at this point.

William Crighton _CCC_
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.
June 3, 2015

Sorry I was unclear - I thought you'd throw the message up on the form to make users aware of what will happen to their comment if they add one (that you have automation that'll delete it). The best solution though is to just hide the damn comment field entirely if a condition is met. There's a post on someone's fail trying to do just that: https://answers.atlassian.com/questions/12159767/setting-comment-fields-hiddenshown-with-script-runner-plugin-not-functioning

0 votes
Yana Stoliarova February 9, 2021

I used ScriptRunner Fragments (Hide)

Screenshot 2021-02-09 at 16.32.05.pngScreenshot 2021-02-09 at 16.31.50.png

0 votes
Eban Tomlinson June 3, 2015

Cheers!

0 votes
William Crighton _CCC_
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.
June 3, 2015

nice question, _very_ nice instant feedback on replies to question. Nice to work with you -wc

0 votes
Chander Inguva
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.
June 3, 2015

Hi Eban,

                I would say try Behaviours Add On which comes with Script Runner Plugin and Add behaviours for issue types as said by Stas

Good Luck!!

Regards

Chander Inguva

0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2015

If the project only has that issue type you can remove everyone's permission to comment. However, permissions are at the project level, not the issue type level.

Eban Tomlinson June 3, 2015

A viable option, but not in this case as I have other issue types in this project. Thanks though!

Suggest an answer

Log in or Sign up to answer