Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Remove comments field on transition

Edited

how to remove comments field on transitionAnnotazione 2019-02-06 140200.png

this code it does not work:::::

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.fields.layout.field.FieldLayoutItemImpl.Builder
import com.atlassian.jira.component.ComponentAccessor
def c = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName("comment");
c.setHidden(true);
//issue.getFieldById("Comment").setHidden(true);

4 answers

1 accepted

2 votes
Answer accepted

Hello @Stefano Rosario Aruta

I had the same issue just last week and solved it with ScriptRunner Behaviours.

Was easy to configure for specific transitions only rather than the whole Jira instance and works well. 

Kevin Johnson Community Leader Oct 19, 2019

if you have the scripts can you please share cause i too wanna hide the comment field from a transition screen but i dont know how to do that or proper scripts to do that

Hello @Kevin Johnson 

I am afraid I cannot provide a script since my proposed solution requires the Behaviours plugin. Do you have that and struggle setting up the comments field as hidden on a transition?

Here's a quick introduction:

  1. Open Behaviours in the Jira Admin Add-ons section and click Add Behaviour.
  2. Click the Fields link on the newly created behaviour.
  3. Choose the workflow you want to hide comments on as the Guide Workflow.
  4. Add Comment as a field and click on Shown to make it hidden.
  5. Add a condition and choose the required Workflow Action you want to hide the comment on. 

I hope it works for you. 

Like # people like this
Kevin Johnson Community Leader Oct 21, 2019

haha i know how it works and i can clearly state a step by step procedure to do it like you did 

the problem is there is no proper way to code the scripts part thats the only issue 

can you help in that ??

@Nadine Schütt , that feature of ScriptRunner is not available in JIRA Cloud. Is there any other way to hide the comment field in the transition screen?

Like Mike Hayes likes this
1 vote

You will need a script or automation to identify which ones you want rid of and destroy them.

can you make the script?

Why not just edit the Announcement Banner (System > User Interface > Accouncement Banner) and inject some CSS styles to simply hide the comment input... simple, but effective and no custom fields need to be edited to inject javascript.

For one specific form:

<style type="text/css">
div#edit-issue-dialog div.form-body div.content div.field-group.comment-input {
display: none;
}
</style>

or... for all forms:

<style type="text/css">
div.jira-dialog div.form-body div.content div.field-group.comment-input {
display: none;
}
</style> 

 

it doesn't work jira core 8.4.2

Hi A L. The above code was based on core 7.13, so they probably changed the style rules somewhat for the newer version. That said, the same technique of injecting global CSS styles via the announcement banner should still work.

You will have to use your browser development tools (firebug or chrome dev tools) to inspect the DOM and determine the appropriate selector for the comment field that you wish to hide.

Small change for Jira 8.15 (server)

<style type="text/css">
section#edit-issue-dialog div.form-body div.content div.field-group.comment-input {
display: none;
}
</style>

Hi @Stefano Rosario Aruta!

Please, check the similar question and the answers below:

Remove comments on transition

Hope it helps.

Is not what you want?

i want remove the field comment on the screen when i do a transiction

I see. Check the similar question:

Hide "Comment" field on transition screens

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

787 views 17 21
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you