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

Java provided attribute doesn't populate value set on modifying of work item

Hi all,

I've created a Java provided attribute for a work item that provides a value set by looking at two other attributes (enumerations) from the same/current work item which together form a directory path that the java provided attribute will create a value set using the names of files nested in that directory. It works well if a work item is created for the first time however on modifying the work item, it fails to populate the set so a new value can be selected.

I'm not sure how to have the java provided re-populate the set so a new value can be selected. I have de-bugged it and seen that when it tries to get the values of the two enumeration attributes that it returns an empty string each time though the attributes have values set.

Below is a link to my class file.

http://www.megafileupload.com/hPqE/SpecificArtifactType.java

Any help appreciated.
Thanks

0 votes



2 answers

Permanent link
Hi Paul,

I believe you would have to write an operation participant that is triggered to re-populate the set on some operation, like a work item save.

Here is a post with an example of an participant:

https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/

1 vote

Comments

Hi Marek,


Thanks for your reply. I don't think a participant is right option. The list needs to be repopulated with the files in the directory (decided by the two attributes) before a save operation. 


Permanent link
Paul, have you set the dependencies to the other two attributes? If it is a calculated attribute, the calculation would be triggered by a change to either of them only if there is a dependency in the attribute customization.

0 votes

Comments

I dug deeper and found that when it gets to this statement:


IAttribute currentAttribute= (IAttribute) handle;

That an exception is generated. It can't cast to IAttribute handle because the return items from workItem.getCustomAttributes() are different between a new Wotk Item and a modified work item.

The exception message is:

com.ibm.team.workitem.common.internal.model.impl.AttributeHandleImpl incompatible with com.ibm.team.workitem.common.model.IAttribute

From here, I'm not sure how to get the IAttributeHandle that I can cast to IAttribute.


1 vote

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: Oct 02 '15, 8:41 p.m.

Question was seen: 1,730 times

Last updated: Oct 04 '15, 9:01 a.m.

Confirmation Cancel Confirm