WorkItemClient findAttribute returns null for Acceptance field
Hello,
I am trying to fetch the "Acceptance Criteria" attribute of the story work item, using the plain java RTC api through the following code. IAttribute attribute=workItemClient.findAttribute(workItem.getProjectArea(), "com.ibm.team.apt.attribute.acceptance", monitor); The above code works fine with jazz.net sandbox(version 5.0.2) and returns the IAttribute instance of the relevant work item. But it returns null when tested with RTC version 4.0.6 repository. Kindly let me know what could be the issue with 4.0.6 repository? Note: I have changed the java RTC api version accordingly. Expecting your valuable reply. thanks Ambarish |
2 answers
I don't know the answer, but it might help to list out all the attributes found for that workitem type.
note this field is ONLY for story type workitems. I use this on my sample code here if (workItem.hasAttribute(ia) && !ia.isInternal()) Comments
Ambarish Mohan
commented Feb 21 '15, 8:57 a.m.
Thanks a lot.
sam detweiler
commented Feb 21 '15, 12:31 p.m.
and you don't have an accidental space char in the name, right?
Ambarish Mohan
commented Feb 23 '15, 11:55 a.m.
Yes.
Ambarish Mohan
commented Feb 23 '15, 9:02 p.m.
Exactly you are correct. How to change the short name "acceptance" to the long name identifier value. Please assist me.
sam detweiler
commented Feb 23 '15, 9:56 p.m.
you cannot change the ID. you 'could' create another attribute with a different name and the right ID, then export all the current story work items id and acceptance test field,
Ambarish Mohan
commented Feb 23 '15, 10:02 p.m.
Thanks for your reply.
sam detweiler
commented Feb 23 '15, 10:08 p.m.
Yes, it should work using the short ID.. note you have to use ID not the NAME.
Ambarish Mohan
commented Feb 23 '15, 10:13 p.m.
But sam,
sam detweiler
commented Feb 23 '15, 10:30 p.m.
can you run my utility, and see what is actually used for that attribute?
Ambarish Mohan
commented Feb 23 '15, 10:57 p.m.
In order to run the utility i don't have these classes resolved in my classpath
sam detweiler
commented Feb 24 '15, 7:08 a.m.
sorry, those are in the sdk plugins folder. you can comment out the imports. they are not used
Ambarish Mohan
commented Feb 24 '15, 9:27 a.m.
Usage: QueryWorkItems <repositoryuri> <userid> <password> <projectarea> <queryname>
sam detweiler
commented Feb 24 '15, 9:53 a.m.
that is the name string of the workitem query you created via eclipse or the web ui.
Ambarish Mohan
commented Feb 24 '15, 10:14 a.m.
Can you please give me an example query?
sam detweiler
commented Feb 24 '15, 10:21 a.m.
sure, create a query named 'all storys', which selects workitem type=story,
sam detweiler
commented Feb 24 '15, 12:26 p.m.
Hm.. Ralph.. I run my utility, executing a query as above, has 1 story workitem..
1
sam detweiler
commented Feb 24 '15, 3:30 p.m.
never mind, somehow this project also is considered a plugin project, so the plugin platform jars were included incorrectly..
Ambarish Mohan
commented Feb 25 '15, 8:07 p.m.
This is my output
Ambarish Mohan
commented Feb 25 '15, 10:04 p.m.
Also sam,
So the ID you should use with this process area is "acceptance".
Ambarish Mohan
commented Feb 26 '15, 3:16 a.m.
Oh Ok fine Ralph.
showing 5 of 21
show 16 more comments
|
I see the long name for my 4.0.6 installation
if you only see the shortname, that is clearly why the request for the longname will return null. (cause the longname is not found) Comments I think the valid answer is that you have to provide a valid, existing attribute ID, otherwise findAttribute returns null - as described in the code.
Ambarish Mohan
commented Feb 24 '15, 6:56 a.m.
But, the valid existing attribute ID is "acceptance". But findAttribute still returns null. This is where my exact problem is.
Did you check if the item actually has the attribute? If the attribute has been introduced later, it might not be available. Sam provided you with the code above. You would have to synchronize attributes to make sure.
Ralph Schoon
commented Feb 24 '15, 7:07 a.m.
| edited Feb 24 '15, 7:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Sorry, forget the last statement. You can use https://rsjazz.wordpress.com/2015/02/09/a-rtc-workitem-command-line-version-2/ to check for the attribute ID's it will however only report back the internal ID's for built in attributes.
Ambarish Mohan
commented Feb 24 '15, 8:15 a.m.
Yes Ralph. The tool returns a set of attributes among which "Acceptance Test" is not listed as it doesn't belongs to the built-in attributes.
Ralph Schoon
commented Feb 24 '15, 8:23 a.m.
| edited Feb 24 '15, 8:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
https://rsjazz.wordpress.com/2015/02/09/a-rtc-workitem-command-line-version-2/ returns the built in as well as the custom attributes. If the attribute does not show for a type, it is not available on the type - which explains the null value.
sam detweiler
commented Feb 24 '15, 8:29 a.m.
But this is Story Acceptance Test which has been there since the late 3.x days.
It might have an internal/short name. I don't have 4.0.6 available right now.
Ambarish Mohan
commented Feb 24 '15, 8:40 a.m.
The attribute is not showing in the result whereas through the code,
i meant running a query in the tool and select the attributes you want to see.
That attribute "Acceptance Test" is not at all being listed in the tool output. Even for version 5.0.2 it is not getting listed in the tool output.
Then you don't have the attribute in your template. It was either removed or you use a template without it. Look at the editor presentations and try to identify which attribute is used, if at all.
showing 5 of 12
show 7 more comments
|
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.