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

Getting an IAttribute object from an attribute id on a server extension

 Hi everyone,

I want to use getValue on a WorkItem in my Server Extension, but for that I need an IAttribute object.
I have the attribute id.
How do I get the IAttribute object?

Thanks

For reference I tried:
this, this and some bits of this which gave me the error:
failed to find the required service 'interface com.ibm.team.workitem.common.IWorkItemCommon'
even tho I have IWorkItemCommon in my prerequisites.

0 votes



3 answers

Permanent link
You probably need to use IWorkItemServer (which extend IWorkItemCommon) as prerequisite and in the getService method. Then you can also use it for the rest of the operation or cast it to IWorkItemCommon.

1 vote


Permanent link
https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ shows how this is done in a participant/follow up action and the same mechanism applies in advisors/precondition. It is basically the same mechanism explained in https://jazz.net/forum/questions/226930/how-to-get-icontributor-objects-from-a-workitem where you don't specify the context.

You should use IWorkItemCommon wherever you can and it is possible to use it here. I don't know why you can't get it. I agree with Michele on the alternative and the example above uses IWorkItemServer an works. 

0 votes


Permanent link
 I had to recreate the plugin project for the WorkItemServer to work. weird...

0 votes

Comments

Well, if you change a something in the plugin.xml (like the prerequisites) you always have to recompile and restart the server, also when you are on debug mode.

1 vote

yeah I did restart the server and recompile, but fsr it didn't work.

Glad it works now tho and thanks for your response

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
× 10,938
× 369

Question asked: Aug 18 '16, 5:05 a.m.

Question was seen: 3,349 times

Last updated: Aug 22 '16, 1:51 a.m.

Confirmation Cancel Confirm