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

How to get values of attributes of workitem using Plain Java API ?

 Hi All ,
          I want to access all  values of attribute type team area,Enumeration,Project area,Timestamp ,duration etc ..  depending upon user choice .
 Means if user want  to access the 3 attributes value of particular WI for example  created date, created by ,tags  
 then values of these attributes should be displayed on console.
           so My problem is how to access that attributes values depending on User Choice. I have code for  accessing the values of all attributes which are in WI . but i want to fetch the attribute value of user choice not all .

0 votes

Comments

I am basically not sure what the use case is. The explanation does not really help. You might want to enhance your question.

 Hi Ralph,

  I want to develop command Line Application. In this Command Line application I have take input from the User as Attribute Id and Depending upon user selected ID, i have to access the values of attribute and Display it. 
   I am able to get the values of String ,Contributor, category,string Types but problem occur when i am trying to access the values of Tags ,Timestamp , teamarea, subscribers, because ID's i am getting From Eclipse Client are not correct.
I also tried with Web UI Attribute Id , it Works for some attributes but not for all. so how can get the values of all the attributes ? 

You can get the values as described in several posts on my blog. Start here https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ see here: https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ search my blog. This can read and write all attributes (I am aware of) as well and has code attached https://rsjazz.wordpress.com/2015/11/03/a-rtc-workitem-command-line-version-3-0/ .


Accepted answer

Permanent link
well, you would have to make some cross reference table, that identified a user readable attribute name and the actual attribute name behind it.   your code would look up the user selected type to get the actual field attribute id, and use that to get its value.

I don't know what 'console' means, but from commandline it would be pretty easy.
shweta ranaware selected this answer as the correct answer

0 votes

Comments

 Hi  sam, 

Thanks for your reply,
  I am working on Command Line and GUI based Application In which i want to take some attributes Id from user and have to check whether that attributes are present in the Work item or not if Present then get the value of that particular Attribute.
     As per my Knowledge i am able to access the values of String Data Types,Contributor ,Category ,Project Area but how can get the values of Team area, tags,subscribers,Item,E-signature,Enumeration List,Iteration,time Line,wiki etc datatypes Present in the RTC.

 It is Giving Problem when attributes ID of Attributes are different in Web UI and RTC Eclipse client .

Please see https://rsjazz.wordpress.com/2015/11/03/a-rtc-workitem-command-line-version-3-0/ and the code attached which basically can access all attribute and non attribute types I am aware of.

Most interesting classes in com.ibm.js.team.workitem.commandline.helper and com.ibm.js.team.workitem.commandline.utils or search the blog for keywords.

With respect to the ID's use the ones displayed in the Web UI. See https://jazz.net/forum/questions/210676/problem-in-accessing-enumeration-in-work-item-using-client-java-api for what we found.


One other answer

Permanent link
the accepted answer here, https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes will print out all the attributes of a workitem, including its ID.




0 votes

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,942

Question asked: Nov 09 '15, 6:17 a.m.

Question was seen: 4,173 times

Last updated: Nov 10 '15, 7:27 a.m.

Confirmation Cancel Confirm