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

how to access the data in a custon attribute (eneumeration) from rtc using rpe

I have 2 custom attributes of the type enumeration for defects.  1 is used to set the probability of occurrence for the defect and the other is to set the risk level.

Example: 

Estimated Occurrence is 2 - Improbable

Risk Level is 4 - ALARP

1

0 votes

Comments

risk_level.literal.l4

 

estimated_occurrence.literal.l5



2 answers

Permanent link
 Hello Peter,
Ralph authored a good article about Manipulating Work Item Enumeration Values

Hope this will help.

Thanks.
Eric.

0 votes


Permanent link
Since RPE 1.2, you can pass complex variables between scripts.  I use this method to construct a hashtable, stored in an RPE internal variable, containing the enumeration identifiers and literals, then read from the hashtable when I need to translate the identifier stored in a workitem attribute with the actual literal.

To create the hashtable, I use a scripted variable under these nested queries:
workitem/projectArea (with a native filter of name='<projectAreaName>')
  workitem/projectArea/enumerations (with a scripted filter of id == "valueprovided" )
    workitem/projectArea/enumerations/literals

My variable is then populated by this script:
java.util.Hashtable(myHashtable).put(id,name);
myHashtable


I then execute this query:
workitem/workItem/StringExtensions
and under that query populate another internal variable that I eventually use to output the enumeration literal.  This is the script I use to populate the second internal variable:

if (key=="<workItemAttributeIdentifier>")
{
output= java.util.Hashtable(myHashtable).get(value);
}
output


I would be interested in hearing if anyone has found a simpler way to do this. 

Note that if you are using a version of RPE prior to 1.2, you would need to serialize/deserialize the hashtable in order to pass it between scripts.  This is discussed here: https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14873579

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

Question asked: Apr 05 '13, 3:48 p.m.

Question was seen: 6,200 times

Last updated: Apr 09 '13, 7:30 a.m.

Confirmation Cancel Confirm