How to remove "comment" textbox appear by default in transition created screen.

dhaval soni
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 17, 2013

when add new screen in jira then it does not show "comment" field but when associated with transition and appear while actionaning workflow transition then that screen appear default with comment textbox.

As we have added other custom fields and screen does not need comment textbox..

can we remove this ?

thanks

10 answers

5 votes
Bhupesh Nagda November 26, 2014
  1. JIRA 6.1.x steps.
  2. Go to Field Configuration
  3. Edit one of the custom fields also appearing on the transition screen wherein you want to hide comment.
  4. Put below JS
<script type="text/javascript">
if(AJS.$('#issue-workflow-transition-submit').val() =='Transition Name'){
AJS.$('div.comment-input').css('display''none');
}
</script>
    5. Transition Name in the above script should be replaced with actual transition name for which you want to hide the comment field  
Cristian _Southend_ November 27, 2014

@Bhupesh Nagda works in jira 6.3.x?

Mark Gillespie December 11, 2014

None of these things work in JIRA 6.3

Like Alexander Grimstad likes this
Paul Huemmer August 27, 2015

This worked for me in 6.3.5

Ganga Bopaiah October 25, 2018

worked for me in jira 7.4.1

Alexander Grimstad February 28, 2019

Thanks Bhupesh!
Works perfectly in `v7.12.3#712004`, but when saving the field config, the admin page goes blank. Just a refresh and everything is back to normal. 

Allison Marie Carlson August 8, 2019

Thanks Bhupesh Nagda!

This worked perfectly for me,  in JIRA Server 7.11.  It hid the comments field on one transition screen only, which is exactly what I wanted.

-   in Field Configuration, edited one of the custom fields also appearing on the transition screen
-  Put below JS in the 'Field Description':
<script type="text/javascript">
if(AJS.$('#issue-workflow-transition-submit').val() =='my transition name'){
AJS.$('div.comment-input').css('display', 'none'); }
</script>

cgadade May 27, 2020

Hi @Allison Marie Carlson ,

   Is above script is working for Jira Service desk,In my case it is working for Jira Software but unfortunately ,it is not working for jira service desk,Can you please help me.

 

Thanks in advance.

Allison Carlson June 4, 2020

hi @cgadade 

I only tried this in Jira Software, not in Jira Service Desk.

Are you trying to hide comments from the Portal? or from a Transition screen that displays for a JIRA SD project when an issue is transitioned by a JSD Agent?

0 votes
RKR84 March 2, 2021

Still works in Jira DC v8.5.11 thanks !

0 votes
Ranjit Vadakkan October 27, 2014

<script language="javascript">if(document.getElementById("edit-issue-dialog")){document.getElementById("comment-wiki-edit").parentElement.parentElement.style.display='none';}</script>

Put this in the 'Description' of your custom field. This will hide the Comments field on the 'Edit Issue' dialog, which is where I needed to hide him. It will not hide it anywhere else.

Sure, you can have more null checks, but this works for me in Chrome and IE, so I'm not going to spend more time making it resilient.

I am running JIRA 6.2.2.

Joe Torres (Admin) June 21, 2016

Hello Ranjit,

I used the above in the description and all it did was update the description with the new text.  Is there anything else you would recommend?

 

thanks

0 votes
M February 26, 2014

Hi, just for information, when you user this plugin ( Behviours Plugin) to hide the comment, it is hidden everywhere. In my test, if i'm not wrong, you cannot hide it for specific screen. when you view a issue, the comment is always displyed, but not accessible.

In conclusion, you cannot hide this field only when you edit an issue, or attached a file, you cannot use this feature anymore.

0 votes
Caner Arda December 3, 2013

You can hide comments or other fields using Behaviours Plugin. Lots of features. It is highly customizable (which transition, status, which user etc.) and you do not need to do coding for basic stuff.

0 votes
Nadir MEZIANI
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 17, 2013
Hi, Try this. AJS.$(window).load(AJS.$("#comment").parent().hide());
dhaval soni
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 17, 2013

no luck.. tried at select Field and Message(edit) field...

have tried by putting script tag and without it..

0 votes
Nadir MEZIANI
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 17, 2013
Hi Put this script in the description of a customfield and it will work. <script type="text/javascript"> AJS.$(window).load(function(){AJS.$("#comment").parent().hide();}); </script>
dhaval soni
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 17, 2013

I have put at description of custom field. also tried by putting at - Field configuraiton - descrition .

but comment box is still appear in issue transition screen.

Nadir MEZIANI
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 17, 2013

Hi,

Have you debug it with fire bug, in JIRA 5.2.8, it work fine.

0 votes
Nadir MEZIANI
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 17, 2013
Hi, I have some problem (some JS don't loaded , I can't add a comment Can you give me your JIRA version?
dhaval soni
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 17, 2013

jira 5.2.11 stand alone.

0 votes
RambanamP
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 17, 2013

add the following script in any field description on field configuraion of that issue type which is present on that transition by changing transition name

<script type="text/javascript">
jQuery(document).ready(	function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
	callCommentHideFunction();
});	
callCommentHideFunction();
function callCommentHideFunction(){
	if($('#issue-workflow-transition-submit').val() =='working'){
		$(".wiki-edit").hide();
$("label[for='comment']").hide(); } } }); </script>

dhaval soni
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 17, 2013

its not working.. can you please see below if i missed any thing to add:

Have added that stuff under one of custom field's descrition (under "field configuration"). that field is used in a transition screen where "comment" textbox is appear.

In your javascript snippet, have just changed transition name as "#Send for Peer Review" and not changed any thing else.. my stuff looks as below:

&lt;script type="text/javascript"&gt;
jQuery(document).ready( function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
    callCommentHideFunction();
}); 
callCommentHideFunction();
function callCommentHideFunction(){
    if($('#Send for Peer Review').val() =='working'){
        $('#comment').closest('div.field-group').hide();
    }
}
});
 
&lt;/script&gt;

what is missing here..

dhaval soni
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 17, 2013

i've used same transition name which is given at workflow transition.

Not included ID like - "Send for Peer Review(11)"

RambanamP
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 17, 2013

pls change only transition name(working, if you need to remove comment on working transition then no need to change anything, copy as it is to field configuration) and check the answer again i have modified

RambanamP
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 17, 2013

i have tested my code on jira 5.2.5 and it worked fine, i hope it should work on jira 5.2.11 also

dhaval soni
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 17, 2013

ok. i have used updated script and just replaced "working" with "transaction name" (i.e. given in workflow).

when i use this in field description then after, jira issue just shows me processing icon while actionanig transition so, screen should be open but it just shows processing and unable to open that screen.

(even also, in administrator, custom fields list shows that particular custom field without any "Type", "available context", "screen" , just shows field name.

Have also tried by removing condition and only keep hide statement though same thing.

dhaval soni
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 17, 2013

just to confirm: i use below stuff (where just replaced "Working" with my workflow transition name. (and put this at - Custom field >> edit >> description)

&lt;script type="text/javascript"&gt;
jQuery(document).ready( function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
    callCommentHideFunction();
}); 
callCommentHideFunction();
function callCommentHideFunction(){
    if($('#issue-workflow-transition-submit').val() =='Send Peer Review'){
        $(".wiki-edit").hide();&lt;br&gt;     $("label[for='comment']").hide();
    }
}
});
 
&lt;/script&gt;

Please have a look at above script if any issue which i do use.

dhaval soni
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 17, 2013

i just look at firebug...inspect element and scripts .. could not find script in transition screen...(looks like not assocated so, not taking effect... or may not be find correctly at firebug and existed in some script file).

RambanamP
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 17, 2013

it's Weired!!, i tested before posting here and it worked fine.

make sure that you have added javascript on field configuration of the issuetype which you are testing.

you can remove the condition and test then it should hide the comment field on all transitions

Cristian _Southend_ February 5, 2014

not work in Jira 6.1.6 :(

RambanamP
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.
October 29, 2014

i am using following code on jira 6.X.X versions, it is working file! $(".comment-input").hide();

Cristian _Southend_ October 31, 2014

only "$(".comment-input").hide();" ???

Wei Qiao March 14, 2015

I think Rambanam means put only "$(".comment-input").hide(); instead of $(".wiki-edit").hide(); $("label[for='comment']").hide();

Wei Qiao March 14, 2015

I can hide the Comment field on the transition screen. However, it fails to add a comment in the view screen RIGHT after finishing the transition. The reason probably because comment field is hided. So is there a way to make comment field show after you hide it during that particular transition?

0 votes
Nadir MEZIANI
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 17, 2013
Hi, You can do it with the permission scheme or add some javascript in the screen to hide the comment field
dhaval soni
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 17, 2013

How can we add javascript in screen ? , can you please share me some example or stuff and where to write it.

dhaval soni
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 17, 2013

what to do in permission scheme to remove this comment box.

Do you mean by removing comments rights ? but then it will remove from issue view screen - comments too ?

will it be possible to remove just on issue transition screen only through permission scheme?

Suggest an answer

Log in or Sign up to answer