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

Thursday, April 6, 2017 2:40:41 AM

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 7:18:29 PM
Avatar
re: csimonson1 on Thursday, April 6, 2017 2:40:41 AM

Hi Carlotta

Please use the following:

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


Regards

Jim

Wednesday, May 31, 2017 11:07:36 PM
Avatar
re: inflectra.jimx on 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.

Statistics
  • Started: Thursday, April 6, 2017 2:40:41 AM
  • Last Reply: Wednesday, May 31, 2017 11:07:36 PM
  • Replies: 2
  • Views: 488