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

Script Field "Issue Picker" does not work with REST API

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: 5.5.0, 5.5.5
    • Fix Version/s: 5.5.7
    • Labels:
      None
    • Sprint:
      Sprint 53
    • Critical Points:
      0

      Description

      Scripted field of type "Issue Picker" does not work properly with the standard Jira REST API.

      Steps to reproduce

      • Create a scripted field of type "Issue Picker"
      • Create an issue with a value inside the scripted field
      • Perform the following PUT call (<JIRA_URL>/rest/api/2/issue/<ISSUE_KEY>):
        {
        	"fields": {
            	       "customfield_xxxxxx": "ISSUE_KEY"
        	}
        }
        

      Expected result

      The scripted field is updated with the new value

      Actual result

      An HTTP 500 error with this body:

      {
          "errorMessages": [
              "Internal server error"
          ],
          "errors": {}
      }
      

      This exception appears within the application log:

      java.lang.ClassCastException: com.atlassian.jira.issue.IssueImpl cannot be cast to java.lang.String
      	at com.atlassian.jira.issue.customfields.impl.rest.TextCustomFieldOperationsHandler.getInitialValue(TextCustomFieldOperationsHandler.java:43)
      	at com.atlassian.jira.issue.customfields.impl.rest.TextCustomFieldOperationsHandler.getInitialValue(TextCustomFieldOperationsHandler.java:17)
      	at com.atlassian.jira.issue.customfields.impl.rest.AbstractCustomFieldOperationsHandler.updateIssueInputParameters(AbstractCustomFieldOperationsHandler.java:75)
      	at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler$IssueInputParametersBuilder.finalizeIssueInputParams(IssueInputParametersAssembler.java:428)
      	at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler$IssueInputParametersBuilder.buildForEdit(IssueInputParametersAssembler.java:230)
      	at com.atlassian.jira.rest.v2.issue.UpdateIssueResource.editIssue(UpdateIssueResource.java:58)
      	at com.atlassian.jira.rest.v2.issue.IssueResource.editIssue(IssueResource.java:768)
      	... 255 more
      

      Note

      The REST call works fine if the scripted field has no value, but if a value is already present the exception is thrown every time

        Attachments

          Activity

            People

            Assignee:
            tbatagiannis Thanos Batagiannis
            Reporter:
            dmondardo Damiano Mondardo [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: