Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Assets: make single attribute read-only

Alexander Lehmann April 15, 2024

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?

2 answers

1 accepted

0 votes
Answer accepted
Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2024

Export the object to a csv:

Export objects.png

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

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

Edit mapping.png

New legacy value.png

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

Legacy attribute reference.png

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

Copy of Name.png

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

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

Link to second.png

Configure the new object so that everyone only has user access

Config for second.png

second groups.png

On the original object delete the old legacy attribute

Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2024

Try all of that out on a test object before doing it with your live data!

 

Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2024

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

Alexander Lehmann June 3, 2024

@Stephen_Lugton 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}

0 votes
Alexandra Neciov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 17, 2024

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

Alexander Lehmann June 3, 2024

Hi @Alexandra Neciov 

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).

Alexandra Neciov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 3, 2024

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events