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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Uncategorized

Friday fun: how many celebrates Midsummer holiday or is this a Swedish tradition only?

Any other country that celebrates Midsummer holiday (this friday 22 June)?  

46 views 3 1
Join discussion

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