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

Unwatch Share Script runner does not work with scripted field properly after upgrade to JIRA 6.3

    Details

    • Type: Change
    • Status: Done
    • Priority: Critical
    • Resolution: Incomplete
    • Affects Version/s: 3.0.7
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      JIRA 6.3.12 (OS: RHEL)

    • Critical Points:
      0

      Description

      Hello,
      I am using a Scripted Field to count the number of times an issue has been reopened.
      Name: Reopen Counter
      Type: Scripted Field
      Issue type(s): Global (all issues)

      But after I upgraded from JIRA 6.2 to 6.3 - the value "Reopen Counter" is 0 for all issues. Neither does it increment the values for new issues. I have the latest version of the Script Runner plugin.

      The way "Reopen Counter" is scripted:

      import com.atlassian.jira.ComponentManager
      import groovy.sql.Sql
      import java.sql.Connection
      import org.ofbiz.core.entity.ConnectionFactory
      import org.ofbiz.core.entity.DelegatorInterface
      ComponentManager componentManager = ComponentManager.getInstance()
      delegator = (DelegatorInterface) componentManager.getComponentInstanceOfType(DelegatorInterface.class)
      String helperName = delegator.getGroupHelperName("default");
      this.issueid = issue.id
      def sqlStmt = """
      SELECT NEWSTRING AS Status, count AS Number
      FROM changeitem, changegroup, jiraissue
      WHERE changeitem.field = 'Status'
      AND changeitem.groupid = changegroup.id
      AND changegroup.issueid = jiraissue.id
      AND jiraissue.ID = ${this.issueid}
      AND changeitem.NEWSTRING = 'Reopened'
      Group By NEWSTRING
      """
      Connection conn = ConnectionFactory.getConnection(helperName);
      Sql sql = new Sql(conn)
      row = sql.firstRow(sqlStmt)
      sql.close()
      if (row == null)

      { v = 0 }

      else

      { v = row.Number }

      d = (double)v
      this.value = d

      I hope that Jamie Echlin is going to help.

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            gts.tea@gmail.com gts.tea
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: