Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

How can I use Project Area in XPath for Value Set?

<p>
 I would like to use something like the following to find the correct project in my XML:
</p>
<p>
</p>
<pre>
values/project[@name='${com.ibm.team.workitem.attribute.projectarea.value}']/build_numbers/build_number
</pre>
<p>
</p>
<p>
 When testing this, the value used for this variable appears to be blank (i.e. [@name = '']).
</p>
<p>
 I have also tried
</p>
<pre>
com.ibm.team.workitem.attribute.projectarea.label
</pre>
which throws an error when testing, and
<pre>
projectarea.value
</pre>
which has the same result as above.
<p>
</p>
<p>
 My XML file is properly formatted as when I use the actual Project Name instead of the variable everything works fine.
</p>
<p>
 Also note, I am not able to use the value from ANY attribute using this method. If I change the id above the result is the same. Perhaps my syntax is wrong, but it would be nice if the documentation for this told you where to look to find id's of the available attributes.
</p>

0 votes

Comments

I cannot recognize the data source. What does your XML file look like?

The question is about proper usage of the attributes from RTC, the XML source can be anything this is just an example.



2 answers

Permanent link
All I have tried is documented here:
Process Enactment Workshop for the Rational solution for Collaborative Lifecycle Management what I was able to achieve is on page 95 of the version pew-rtc-lab-workbook.pdf. I don't know what is wrong with your statement. I would try to hard code a project area name in first and then go from there.

0 votes

Comments

Hi Ralph, thanks for the post. It would be great if more information like this was referenced by the online help or easier to find in Jazz.net searches. I couldn't find any examples beyond the one found here (many other sources reference the same exact example. This example doesn't explain how to find the id of the attributes that you can use in the path. I was able to figure this out on my own. The answer is attached.


Permanent link

I was able to figure this out on my own after much painstaking trial and error. Based on the following line of XML from the process configuration for the project:

<attributedefinition id="com.ibm.team.workitem.attribute.projectarea" type="projectArea" readonly="true" name="Project Area"></attributedefinition>

You would expect that the 'id' field here is the reference for the XPath, but instead you use the 'type' field, in this case 'projectArea'. I could not find any documentation ANYWHERE that explains this, so if you are trying to figure this out for yourself I hope you are able to stumble across this post.

So the actual line of code I used in my XPath Value Set was:

values/project[@name='${projectArea.label}']/build_numbers/build_number

You can also use 'projectArea.value' if you want the Project Identifier instead.

This next paragraph is to help people google this post based on searches I tried hoping to find any information on this topic.

RTC custom value set xpath, RTC custom value set examples, RTC work item customization, RTC xpath variables

0 votes

Comments

You can open the Web UI for the process configuration and go to work items. You can select an attribute and click edit and see and copy paste the ID of the attribute.

Hi Ralph, that is correct. However, the "ID" is NOT used in this query. If you use the ID the query fails. You need the "type" as I mentioned above, which is not listed in the attribute properties. The only place I could find this value was in the XML source configuration.

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

Question asked: Feb 18 '16, 12:49 p.m.

Question was seen: 2,458 times

Last updated: Feb 22 '16, 8:50 a.m.

Confirmation Cancel Confirm