Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

How to hide the comment field only in the Edit screen and not the View screen Edited

I have a requirement to hide the comment field in the Edit screen.  I was able to hide it using the following Behaviours script:

def commentField = getFieldById(getFieldChanged())

if (getFieldScreen().name == "My Edit Screen" && !getActionName())

{ // check if on edit screen
commentField.setHidden(true)
}

But, the problem is that it is also hiding the comment field in the View screen, which I do not want.

For example, after I open/dismiss the Edit screen and clicked on the "Comment" button in the "Comments" tab in the View screen, the "Comment" button disappeared.  Also clicking on the "Comment" button under the Summary in the View screen has no affect.

If I refresh the browser, the "Comment" button appears again in the "Comments" tab, and clicking on it will display the comment field.

Anyone knows how to hide the comment field in the Edit screen without affecting the comment field in the View screen?

 

5 answers

I was able to hide the comment field using javascript code.

In the "Field Configurations", I located a custom field in the View screen and added the following javascript code to the field descripton:

<script> $(document).ready(function(){ $("div.aui-field-wikiedit").hide(500); }); </script>

At run-time, the comment field is hidden in the Edit screen.  The comment field in the View screen is not affected.

0 votes

It should be like this:

def commentField = getFieldById(getFieldChanged())

if ( !getActionName())

{ // check if on edit screen
commentField.setHidden(true)
}

Thanks Alexey.  It didn't work.  It hid the comment field in both Edit and View screens.  I don't want the comment field to be hidden in the View screen.

Hello @Tom L

try this:

def commentField = getFieldById(getFieldChanged())

commentField.setHidden(false)

if ( !getActionName())

{ // check if on edit screen
commentField.setHidden(true)
}

Hi @Mark Markov

It didn't work either.

After you dismiss the Edit screen and click on the "Comment" button in the "Comments" tab in the View screen, the button disappears.  The only way I know of getting the button back is by refreshing the browser, which is not acceptable for the users.

I am trying to do the opposite here. I want to hide the comment on the view screen, but when the user hits the transition button, I want them to be able to insert the comment on this screen.

If this is still interesting:

As this solution worked for me in it's attended purpose, have you checked wether you have configured your "My Edit Screen" also as "View Screen" in your screen scheme? Or maybe upgraded SR to a newer version?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Jira issue check and more advanced commit verifications for Bitbucket DC

Pre-receive hooks that verify the Git commit message, the modified files, and implement similar code change controls used to be requirements of large enterprises working in regulated industries only....

24 views 0 1
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