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

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

9 answers

  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  

@Bhupesh Nagda works in jira 6.3.x?

None of these things work in JIRA 6.3

This worked for me in 6.3.5

Hi, You can do it with the permission scheme or add some javascript in the screen to hide the comment field

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

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?

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>

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..

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

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

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

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

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.

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.

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).

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

not work in Jira 6.1.6 :(

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

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

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

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?

Hi, I have some problem (some JS don't loaded , I can't add a comment Can you give me your JIRA version?

jira 5.2.11 stand alone.

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>

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.

Hi,

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

Hi, Try this. AJS.$(window).load(AJS.$("#comment").parent().hide());

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

have tried by putting script tag and without it..

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.

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.

<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.

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

465 views 7 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you