Assets: make single attribute read-only
Asked by Alexander Lehmann:

In our Assets object scheme we have a legacy attribute that needs to be read-only for all users (even the ones with the permission to edit other attributes in this scheme).

I was able to remove the attribute in the edit screen of the objects view using Javascript.

But for the details view of an object I can't use this hack since the attribute does not have an id or something.

Is there another (better) way to make one single attribute uneditable or read-only?


Answers:
author: Stephen_Lugton
body: Export the object to a csv:

![Export objects.png](https://community.atlassian.com/t5/image/serverpage/image-id/318344i917A34F6481D386A/image-size/large?v=v2&px=999 "Export objects.png")

![Export Objects 2.png](https://community.atlassian.com/t5/image/serverpage/image-id/318345i048226CBE4EB5B45/image-size/large?v=v2&px=999 "Export Objects 2.png")

Create a new object (as a child of the original object) to only hold the legacy attribute data

![New Obkect.png](https://community.atlassian.com/t5/image/serverpage/image-id/318347iB6609E11875FD20A/image-size/large?v=v2&px=999 "New Obkect.png")

Import the csv into the new object - Name and legacy attribute

![Edit mapping.png](https://community.atlassian.com/t5/image/serverpage/image-id/318349iF734232B1E1A9A76/image-size/large?v=v2&px=999 "Edit mapping.png")

![New legacy value.png](https://community.atlassian.com/t5/image/serverpage/image-id/318353iA0C1DC12A8CE3B75/image-size/large?v=v2&px=999 "New legacy value.png")

Create a new attribute on the original object linked to you new object

![Legacy attribute reference.png](https://community.atlassian.com/t5/image/serverpage/image-id/318355i4271FAD6E74E2A91/image-size/large?v=v2&px=999 "Legacy attribute reference.png")

Edit the csv to only contain 2 columns Name and Copy of Name

![Copy of Name.png](https://community.atlassian.com/t5/image/serverpage/image-id/318356iC85A87E998206E21/image-size/large?v=v2&px=999 "Copy of Name.png")

Import the new csv into your old object mapping the 'Copy of Name' to the new attribute

![second import.png](https://community.atlassian.com/t5/image/serverpage/image-id/318357i93522DF0234E8BE8/image-size/large?v=v2&px=999 "second import.png")

Check that in the Object view when you click on the new attribute it takes you to the new object

![legacy ref.png](https://community.atlassian.com/t5/image/serverpage/image-id/318359i65D8EAB7DA98D4FC/image-size/large?v=v2&px=999 "legacy ref.png")

![Link to second.png](https://community.atlassian.com/t5/image/serverpage/image-id/318361i1348EF82B46B8961/image-size/large?v=v2&px=999 "Link to second.png")

Configure the new object so that everyone only has user access

![Config for second.png](https://community.atlassian.com/t5/image/serverpage/image-id/318363iA38AAC9E23A68987/image-size/large?v=v2&px=999 "Config for second.png")

![second groups.png](https://community.atlassian.com/t5/image/serverpage/image-id/318364i1B7676AFD0D18773/image-size/large?v=v2&px=999 "second groups.png")

On the original object delete the old legacy attribute

comments: author: Stephen_Lugton
body: Try all of that out on a test object before doing it with your live data!


author: Stephen_Lugton
body: And to delete the legacy attribute from your original object:

* Export the object as a csv
* Delete all the objects in the original object schema
* Remove the attribute
* Import the objects back from the csv

But really, really important it so test all this on a test object before doing anything with live data


author: Alexander Lehmann
body: [@Stephen_Lugton](/t5/user/viewprofilepage/user-id/5180770) Thank you for your solution.

In addition I added an attribute "Original Object" as a reference to the Original Object in the New (read-only) Object and the following AQL Filter to the "Legacy Attribute Reference" in the Original Object so users can't change it.

"Original Object" = ${Key}


author: Alexandra Neciov
body: Hi Alexander,

Isn't removing it from the Attributes View an acceptable solution for you?

<https://confluence.atlassian.com/servicemanagementserver/customizing-the-object-view-layout-1044784527.html>

I am looking for a solution for what you seem to have solved, removing an attribute from the Edit screen. Could you please provide more details about it?

Thanks in advance.

Alexandra

comments: author: Alexander Lehmann
body: Hi [@Alexandra Neciov](/t5/user/viewprofilepage/user-id/5477951)

removing the attribute from the View still makes it available in the editor.

I needed a way to make the legacy information available to editors of my object without the possiblility to change the value of my legacy information.

I ended up putting the legacy information in an additional object type (see accepted answer).


author: Alexandra Neciov
body: Hi Alexander and thanks for your reply. You mentioned in your initial question the following:

"I was able to remove the attribute in the edit screen of the objects view using Javascript."

Could you please provide more details about how you did it?

Thanks in advance,

Alexandra


Tags: assets

data-center

jira-service-desk-data-center

jira-service-management

jira-service-management-data-center

jira-service-management-server