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

Getting IAttributeHandle from IAttribute


I need to set a value to an enumeration field

I know the IAttribute of the field, and in:
  

it says that i must call function: 

Identifier ident = getLiteralEqualsString (String s, IAttributeHandle ah)

to get the Identifier value.

How I do get the IAttributeHandle from the IAttribute ?

0 votes


Accepted answer

Permanent link

 In your development environment set up based on the RTC Extensions workshop, you use Navigate>Open Type


You enter com.ibm.team.workitem.common.model.IAttribute and open the type. 
Check the interfaces that com.ibm.team.workitem.common.model.IAttribute extends and answer your question.

The getLiteralEqualsString  is a utility that needs to be written. I think it is shown in the post. 

Marcelo Bilezker selected this answer as the correct answer

1 vote

Comments

I resolved it looking at:
https://github.com/jazz-community/rtc-command-line/blob/master/src/com/cli/ccm/WorkItemManager.java


What is confused is that function getLiteralEqualString as shown in the help link
receives as parameter IAttributeHandle, but when it is called, in WorkItemManager.java  it is called with IAttribute

So there is not need to convert IAttribute to IAttributeHandle. It works the same sending IAttribute as parameter, even when getLiteralEqualString receives as parameter IAttributeHandle


My coding is not flawless, so fix the code for getLiteralEqualString. 

I just checked the WCL https://github.com/jazz-community/work-item-command-line and there I also use the IAttributeHandle, but I resolve the handle to the IAttribute every time. This simplifies it for me but is less effective.

 

 

Yes, I did that and works. I had seen this function before, but my problem was that parameter , 
Thanks for the orientation

The APIs in Jazz products/EWM are all about handles and you need to resolve the handle to get at the full object. 

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
× 12,024

Question asked: Nov 22 '21, 7:25 a.m.

Question was seen: 827 times

Last updated: Nov 23 '21, 9:28 a.m.

Confirmation Cancel Confirm