Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

  1. If i enable "Read-only" for that attribute, getting server exception "CRRTC0299E: The work item with the ID 137 cannot be saved because an attempt was made to change the attributes '[ID-StatusChange History]' which are not modifiable."
  2. If i uncheck the field "Permissions" for all the roles, Team Advisor error saying "Permission Denied"

Please advise.

Thanks

Sudar

0 votes


Accepted answer

Permanent link
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

1 vote

Comments

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 !

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)

:(

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.

Then in the editor, you set  the Presentation itself to Read Only (about 1/2 way down in the Edit Presentation dialog is Read-Only, which in the one that I have that works like this, it is set to "True".  This makes it R/O for anybody that uses the Editor Presentation, so all of the UIs.

In Permissions, make sure that the role that the userid running the APis has contains the proper edit permissions on the attribute.

During the execution of the APIs, the API only knows about the R/O characteristics of the attribute itself, not of the editor.  So it allows editing.

If you are still getting the exception, perhaps double-check the R/O characteristic of the attribute itself (edit the custom attribute on the work item at the bottom of the work item type editing window).

1 vote

Great !!

Works fine.

Thank you so much Susan...

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Dec 08 '14, 6:50 a.m.

Question was seen: 4,252 times

Last updated: Dec 08 '14, 8:05 a.m.

Confirmation Cancel Confirm