It's all about the answers!

Ask a question

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


Stephen Valliere (231118) | asked Feb 18 '16, 12:49 p.m.
<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>

Comments
Donald Nong commented Feb 18 '16, 10:56 p.m.

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


Stephen Valliere commented Feb 22 '16, 8:16 a.m.

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
Ralph Schoon (57.1k23642) | answered Feb 19 '16, 4:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

Comments
Stephen Valliere commented Feb 22 '16, 8:24 a.m.

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
Stephen Valliere (231118) | answered Feb 22 '16, 8:40 a.m.

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


Comments
Ralph Schoon commented Feb 22 '16, 8:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Stephen Valliere commented Feb 22 '16, 8:50 a.m.

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 to post your answer.