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

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
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

132 views 6 8
View post

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