Uploaded image for project: 'JIRA'
  1. JIRA
  2. JRA-3382

Custom fields cannot be included in the project release notes

    Details

    • Type: Suggestion
    • Status: Open (View Workflow)
    • Resolution: Unresolved
    • Affects Version/s: 2.6 Pro
    • Fix Version/s: None
    • Component/s: Custom Fields
    • Labels:
      None
    • Feedback Policy:

      JIRA feedback is collected from a number of different sources and is evaluated when planning the product roadmap. If you would like to know more about how JIRA Product Management uses customer input during the planning process, please see our post on Atlassian Answers.

      Description

      I want to enhance the release notes report, so I tried to add a custom defined field in the velocity template releasenotes-text.vm

      Using
      $issue.getString("<custom field>")
      in releasenotes-text.vm I get an exception.

      Aren't the custom fields available via $issue ?
      It doesn't seem to be, because they are not listed via
      $issue.getAllFields().

        Issue Links

          Activity

          Hide
          owen@atlassian.com Owen Fellows added a comment -

          I Believe it is currently not possible to do this as you don't have access to the custom fields within velocity.

          Would be good to add the ManagerFactory into the default velocity context so user customisation is easier. (Not sure how this would effect performance.)

          Show
          owen@atlassian.com Owen Fellows added a comment - I Believe it is currently not possible to do this as you don't have access to the custom fields within velocity. Would be good to add the ManagerFactory into the default velocity context so user customisation is easier. (Not sure how this would effect performance.)
          Hide
          inteco veenion added a comment -

          This is a short except for the Releasenote velocity html template which shows an issue only if the custom field "inReleaseNotes" is true and shows in addition a custom field "externalNotes".

          What is missing?
          1.) How do I get the components of the issues? (We coded our customers as components.)
          2.) And how do I find the user who resolved the issue?

          #foreach ($issue in $issueType.issues)
          #foreach ($cfvalue in $issue.getRelated("ChildCustomFieldValue"))
          #if ($cfvalue.getRelated("ParentCustomField").get(0).getString("name") == "inReleaseNotes")
          #if ($cfvalue.getString("stringvalue") == "Yes")
          <li>[<a href='$!appProps.getString("jira.baseurl")/browse/$issue.getString("key")'>$issue.getString("key")</a>] - $issue.getString("summary")</li>
          #foreach ($cfvalue in $issue.getRelated("ChildCustomFieldValue"))
          #if ($cfvalue.getRelated("ParentCustomField").get(0).getString("name") == "externalNotes")
          $

          {cfvalue.getString("textvalue")}

          <br>
          <br>
          #end
          #end
          #end
          #end
          #end

          #end

          Show
          inteco veenion added a comment - This is a short except for the Releasenote velocity html template which shows an issue only if the custom field "inReleaseNotes" is true and shows in addition a custom field "externalNotes". What is missing? 1.) How do I get the components of the issues? (We coded our customers as components.) 2.) And how do I find the user who resolved the issue? #foreach ($issue in $issueType.issues) #foreach ($cfvalue in $issue.getRelated("ChildCustomFieldValue")) #if ($cfvalue.getRelated("ParentCustomField").get(0).getString("name") == "inReleaseNotes") #if ($cfvalue.getString("stringvalue") == "Yes") <li> [<a href='$!appProps.getString("jira.baseurl")/browse/$issue.getString("key")'>$issue.getString("key")</a>] - $issue.getString("summary")</li> #foreach ($cfvalue in $issue.getRelated("ChildCustomFieldValue")) #if ($cfvalue.getRelated("ParentCustomField").get(0).getString("name") == "externalNotes") $ {cfvalue.getString("textvalue")} <br> <br> #end #end #end #end #end #end
          Hide
          owen@atlassian.com Owen Fellows added a comment -

          In the above code you have used the $cfvalue variable twice. Velocity might get confused by this. If it isn't working as expected i would print out all values as you look and i might give you a hint as to what is going wrong.

          Show
          owen@atlassian.com Owen Fellows added a comment - In the above code you have used the $cfvalue variable twice. Velocity might get confused by this. If it isn't working as expected i would print out all values as you look and i might give you a hint as to what is going wrong.
          Hide
          owen@atlassian.com Owen Fellows added a comment -

          It is not possible to get Issue Components as there are not relations and they are joined through a many to many table.
          The assignee relation is more complicated as we use the OSUser object and not a generic value so with out the UserManager you can not retrieve the assignee or reporter.

          Show
          owen@atlassian.com Owen Fellows added a comment - It is not possible to get Issue Components as there are not relations and they are joined through a many to many table. The assignee relation is more complicated as we use the OSUser object and not a generic value so with out the UserManager you can not retrieve the assignee or reporter.

            People

            • Assignee:
              Unassigned
              Reporter:
              holger Holger Martini
            • Votes:
              8 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: