How to hide comment field on some transition screens

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

In this article, we will understand, how to hide the comment field on any issue transition screen.

This is currently not possible in Jira Server or Datacenter through any in-built feature. Please refer: JRASERVER-12244 - Allow control of whether comment field will be shown on Edit and Transition screens

Solution

Follow the below steps to achieve this use-case.

  • Create any custom field (We created a Single-line Text type custom field with the name Hide_Comment)

  • Find the ID of the custom field. One can find it through UI and also using database.

    • From UI, navigate to Jira Administration > Issues > Custom Field. Find the field Hide_Comment and click on configure. The last part of the URL will display the ID of the custom field. Here it is 12100.

    • To find the ID of the custom field in the database, run the below query on the Jira database directly.

      SQL

      jiradb=# select id from customfield where cfname='Hide_Comment' ;  

      id   

      -------

      12100

      (1 row)

      jiradb=#

  • Add the Javascript below to the description of the custom field. Replace 12100 with the ID of your custom field.

    javascript

    <script type="text/javascript"> cfid = 'customfield_12100' workflowTransition = $('.jira-dialog').attr('id'); if ( typeof hideCommentOnTransitions !== 'undefined') { if ( hideCommentOnTransitions.indexOf(workflowTransition) < 0 ) { hideCommentOnTransitions.push(workflowTransition) } } else { hideCommentOnTransitions = [ workflowTransition ] } $( '#' + cfid ).closest( '.field-group' ).css( 'display', 'none' ); $( document ).ajaxStop(function() { for (var i = 0; i < hideCommentOnTransitions.length; i++) { if ( $( "#" + hideCommentOnTransitions[i] ).length ) { $( "#" + hideCommentOnTransitions[i] ).find( '#comment' ).closest( '.field-group' ).css( 'display', 'none' ); } } }); </script>

  • To add the description

    Go to Project Settings => Fields => Edit the associated Field configuration scheme => Search for the Custom_Field(Hide_Comment) => Click Edit and Add the javascript in the description Box.

  • Next, add this new custom field to the associated issue Transition screen, where you do not want the field comment to appear by default.

  • Next step is to make sure that you have set Enable HTML in field descriptions and list item values to ON under Admin > System > General configuration > Click Edit Settings

  • Now, when the user tries to transition the issue to the desired status, the transition screen does not show the comment field, which was by default visible earlier. It will only display other configured fields.

NOTE

Please note that this is a customisation and Atlassian doesn't support it and there are chances that it may break in future with new product releases or after Jira upgrades, so please proceed with caution.

The above steps are for a specific use-case where the user wants to hide the comment field on transition screen only. It is also good to refer to JRASERVER-12244: Allow control of whether comment field will be shown on Edit and Transition screens which was raised for engineering team in the past but was not taken up.

Updated on March 17, 2025

Still need help?

The Atlassian Community is here for you.