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 edit button on label field Edited

Hi!

I have a custom field (label-type) called "Reporter Department Code". I want to have it as a label field but I don't want the edit button on issue view screen:reporter_department_code_label.PNG

I have seen that there is a solution for this with the assignee field, inserting javascript code on field description:

<script type="text/javascript"> 
var removeCTE = setInterval(function() {
var editableElms = AJS.$('#assignee-val')
if (editableElms.length) { 
editableElms.removeClass('inactive'); 
editableElms.removeClass('editable-field'); 
editableElms.removeAttr('title'); 
editableElms.find('span.overlay-icon').hide(); 
}},500);
</script>



I am trying to use this method to remove the edit button pencil on my "Reporter Department Code" but I do not succeed:

<script type="text/javascript"> 
var removeCTE = setInterval(function() {
var editableElms = AJS.$('#edit-labels-1047756-customfield_13500')
if (editableElms.length){ 
editableElms.removeClass('aui-icon'); 
editableElms.removeClass('aui-icon-small');
  editableElms.removeClass('aui-iconfont-edit');
editableElms.removeClass('edit-labels');
editableElms.removeAttr('href'); 
}},500);
</script>


What am I doing wrong? Is it possible to remove the edit button (pencil) from issue view screen? Making the custom field as an text-field is not an option, I want to have a label-field.

Br, David Henriksson

1 answer

0 votes
Avdhesh Chauhan May 19, 2017

Hi There, 

Just remove that field from Edit screen , that will solve your problem.

Thanks

Hi!

No that doesnt solve the problem. My field "Reporter Department Code" is not in Edit screen and the pen is still visibile.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Off-topic

Disney Live Action Reboots: Are you for or against?

Happy Friday Everyone! Today marks the international release of Disney's live action version of the animated classic Aladdin. I know that this movie was met with some controversy of over cast...

136 views 19 8
Join discussion

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