How do i reference a custom field value and not the internal id of the selection?

Thursday, April 6, 2017
Avatar

the template below lists all the custom fields and displays them with their values.  How do I reference a specific custom field if I don't want all of them listed?  When I tried referencing CUST_02 it displays the values (2,3,4) which is the index of the selected value but not the value itself (which should be text like "no workaround", "has workaround," "cosmetic").  

I want my report to show the CUST_02 field and list the text .  How do i do that? 

 

This works to list all custom fields:

 

<xsl:for-each select="CustomProperties/CustomProperty">

            <xsl:choose>

              <xsl:when test="Type='Date'">

                <td class="Date">

                  <xsl:call-template name="format-date">

                    <xsl:with-param name="datetime" select="Value" />

                  </xsl:call-template>

                </td>

              </xsl:when>

              <xsl:otherwise>

                <td>

                  <xsl:value-of select="Value" disable-output-escaping="yes" />

                </td>

2 Replies
Friday, April 7, 2017
Avatar
inflectra.jimx
re: csimonson1 Thursday, April 6, 2017

Hi Carlotta

Please use the following:

<xsl:value-of select="CustomProperties/CustomProperty[PropertyNumber="2"]/Value">


Regards

Jim

Wednesday, May 31, 2017
Avatar
re: inflectra.jimx Friday, April 7, 2017

Jim when I try to use the statement you gave me in a report like this

 

<td><xsl:value-of select="Requirement/CustomProperties/CustomProperty[PropertyNumber="1"]/Value"></td

 

Please wait while your report is generated...

Name cannot begin with the '1' character, hexadecimal value 0x31. Line 18, position 90.

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Thursday, April 6, 2017
  • Last Reply: Wednesday, May 31, 2017
  • Replies: 2
  • Views: 2820