Uploaded image for project: 'JIRA Components'
  1. JIRA Components
  2. JIRA-19

Allow users to provide a custom displayer in wiki pages

    XMLWordPrintable

Details

    • Idea
    • Resolution: Unresolved
    • Major
    • None
    • 8.3
    • Macro
    • None

    Description

      JIRA Macro idea:
      
      {{jira style="custom" parameters="display.custom.template=My.JIRATemplate"}}
      ...
      {{/jira}}
      
      in My.JIRATemplate:
      
      Bindings:
      - issues --> List<JIRAIssue>
      
      JIRAIssue extends Element
        - getFieldValue(fieldName)
        - getCustomField(fieldName) --> JIRACustomField
      
      JIRACustomField extends Element
        - getKey()
        - getValue()
        - getName()
      
      
      - parameters: JIRAParameters object
      - displayers (map) : Map of JIRADisplayer
      - fields --> List<String> : fields to display
      
      {{velocity}}
      #foreach ($issue in $issues)
        #foreach ($field in $fields)
          ## Specific display for a specific custom field
          #set ($customField = $issue.getCustomField($field))
          #if ("$!customField" != '' && $customField.getKey().endsWith(":url"))
            #set ($renderedValue = "[[Lien>>$customField.getValue()]]"
          #else 
            #set ($renderedValue = $displayers.get($field).displayField($field, $issue))
          #end
          * $renderedValue
        #end
      #end
      {{/velocity}}
      
      
      
      Example:
      ---------
      
      {{jira style="custom" parameters="display.custom.template=My.JIRATemplate"}}
      ...
      {{/jira}}
      
      And in My.JIRATemplate:
      
      {{chart source="inline" ...}}
        #foreach ($issue in $issues)
          ...
        #end
      {{/chart}}
      
      vs example 2
      -------------
      
      Using directly JRJC API...
      
      TODO: try this first!
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: