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

Scripted Field object and value accessed correctly on Issue screen, but not on scripted field edit page

    Details

    • Type: Bug
    • Status: Triage
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: 6.7.0
    • Fix Version/s: None
    • Component/s: Scripted Fields
    • Labels:
      None
    • Critical Points:
      0.5

      Description

      I've created a scripted field for an Epic issue type which works as expected on the Issue screen.

      However, the scripted field's correct value on the Issue screen is different to the preview value on the scripted field edit page.

      It seems the Scripted Fields for Issues in the Epic are not accessed correctly. They are always null objects. As shown in this code snippet:

      // imports etc... 
      issuesInEpic.each
          {
              def issueInEpic = issueManager.getIssueObject(it.id)
              def cf = customFieldManager.getCustomFieldObjectByName("Custom Field")
              log.warn cf.     // null
              def cfValue = issueInEpic.getCustomFieldValue(cf)
              log.warn cfValue // null
          }
      

      Steps to Reproduce

      1. Create an "Epic" Issue in your Jira project.
      2. Create two or more "Task" Issues. 
      3. Assign the Task Issues to the Epic.
      4. Create a Scripted Field for the Issues in the Epic. Give it any value. 
      5. Create a Scripted Field for the Epic Issue type.
      6. From the Epic's Scripted Field, loop through each Issue in the epic and try to access the Scripted Field and its value.

      Expected behaviour
      The Scripted Field in each of the Epic's Issues can be accessed.

      Actual behaviour
      The Scripted Field always returns null when you try to access it.

       

      It's important to stress that this problem only affects the Preview Console on the Scripted Field Edit page. When you look at the Scripted Field on the Issue screen it's working as expected. 

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            jbaldwin Joe Baldwin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: