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

Script Field is not "forced" to process by 'refresh page' or 'refresh-search'

    Details

    • Type: Bug
    • Status: Done
    • Priority: Major
    • Resolution: Obsolete
    • Affects Version/s: 2.1.3
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      JIRA 5.2.8

    • Critical Points:
      0

      Description

      Script Field contains a search for full tree of related issues inside an issue. Problem occurs specially after making some changes in the issues. Our main problems: by refreshing the search or refreshing the page search it can give right answer (same as it gives inside script editor) or can give different result - either based on previous data (even previous-previous data) or calculation (script) based on previous script. Both 'errors' are problem but during our testings (we have been logging similar data as for final outcome + timestamp) we have discovered that script fields are not always forced to process by 'refresh' (both of them). You can see it inside attached log file. I have been refreshing query (both ways) every 1-2 seconds but outcome has different timing.

      Here is the script:

      import com.atlassian.crowd.embedded.api.User
      import com.atlassian.jira.component.ComponentAccessor
      import com.atlassian.jira.issue.Issue
      import com.atlassian.jira.issue.IssueManager
      import com.atlassian.jira.config.properties.APKeys
      import com.atlassian.jira.user.util.UserUtil
      import java.text.SimpleDateFormat
      import java.util.Date

      f = new File("#testWithTime.txt")
      Date today = new Date()
      f.append(issue.key + " -> " + today.toString() + "\n\r")
      String result = ""

      String listAll(issue) {
      res = "<table>"
      def issueLinkManager = ComponentAccessor.getIssueLinkManager()
      def baseUrl = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)
      issueLinkManager.getOutwardLinks(issue.id).each { issueLink ->
      def linkedIssue = issueLink.destinationObject

      res += "<tr>"
      res += "<td><a href=\"" + baseUrl + "/browse/" + linkedIssue.key + "\">" + startStrike + linkedIssue.key + endStrike + "</a></td>"
      f.append("${linkedIssue.key} " + issueLink.issueLinkType.name + "\n\r")
      if (issueLink.issueLinkType.name == "Epic-Story Link" || issueLink.issueLinkType.name == "Parent-Child" || issueLink.issueLinkType.name == "Relates")

      { res += "<td>" res += listAll(linkedIssue) res += "</td>" }

      res += "</tr>"
      }
      res += "</table>"
      return res
      }
      finalResult = listAll(issue)
      return finalResult

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            Alkus Peter Bilo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: