Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-4483

Script Fields value is not displayed in confluence application link

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Low
    • Resolution: Done
    • None
    • 6.40.0
    • Script Fields
    • SR4J Sprint 112
    • 7.7

    Description

      Steps to reproduce

      (scenario reproduced with Jira 8.9.1 and confluence 7.5.0)

      1. Create an application link between Jira and Confluence instance
      2. Create one or more script fields in jira
      3. On any confluence page add the macro "Insert Jira Issue/Filter"
      4. Add the script fields to be displayed on macro display options
      5. Once the macro is added the script fields data is not being shown
      6. In the screenshot below 2 script fields were added: "Date of First Transition" field show the string "$xmlutils.escapeForCdata($value.toString())" and "Custom Scripted Field" shows no data

      Workaround

      Create a Custom Script Field with the following configuration which will work the same as the Date of First Transition:

       
      import com.atlassian.jira.component.ComponentAccessor
      
      // replace the issue status as you desired
      def issueStatus = "In Progress" 
      
      def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
      def created = changeHistoryManager.getChangeItemsForField(issue, "status").find {
          it.toString == issueStatus 
      }?.getCreated()
      
      def createdTime = created?.getTime()
      
      createdTime ? new Date(createdTime) : null
      

      Attachments

        Issue Links

          Activity

            People

              jechlin Jamie Echlin
              bcarlosdacunha Bruno Carlos da Cunha
              Votes:
              5 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: