How to change values of read-only custom attributes programmatically?
Hi, Kindly someone help me for this need. I would require to programmatically update custom attribute values. I am getting failed in both the operations below.
Please advise. Thanks Sudar |
Accepted answer
My understanding is that if you make the *attribute* read-only, then the attribute is read-only regardless of what method is attempting to change it (UI vs API).
You can make the attribute show as Read-only in the editor but leave the attribute itself read-write, which would allow the APIs to change it (assuming the userid which is running the API has permissions to change the attribute) but the anyone using the UI (eclipse/web) would see it as a R/O attribute and not be able to change anything. Susan Sudaraazhi Arivalagan selected this answer as the correct answer
Comments
Sudaraazhi Arivalagan
commented Dec 08 '14, 7:12 a.m.
Thank you so much Susan !! I use API method to change the values, UI should be read-only[non-editable] How do i make the attribute itself read-write?
Thanks !
Sudaraazhi Arivalagan
commented Dec 08 '14, 7:17 a.m.
As you say, If i enable the attribute "Read-only" in the editor, and userid has permission to edit that field, I get the server exception error. If i disable the field "Read-only" in the editor, and userid has permission to edit that field, this allows user to edit that field in UI(eclipse) :( 1
Susan Hanson
commented Dec 08 '14, 7:37 a.m.
If you edit the custom attribute (for example, I use the Eclipse UI), There is a "read-only" checkbox near the bottom above the Dependency block. You would have that NOT checked, so that means the attribute itself is read-write.
Sudaraazhi Arivalagan
commented Dec 08 '14, 8:05 a.m.
Great !! Works fine. Thank you so much Susan... |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.