Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-79078

Scripted field update causes unexpected changes in additional fields

XMLWordPrintable

      Issue Summary

      A few Xray fields unexpectedly updated, while only the field referenced in the script should be updated.

      Steps to Reproduce

      1. Download Jira 10.3.9/9.12.22 and download Xray and Scriptrunner plugins.

      2. Configure an issue in such a way that a few Xray customfields are populated (Test Execution Defects, TestRunStatus). 

      Scenario using Jira API code (IssueInputParameters):

      3. Run the following code in the ScriptRunner console:

      import com.atlassian.jira.component.ComponentAccessor
      def issueService = ComponentAccessor.issueService
      def issue = Issues.getByKey('XRAY-6')
      def author = Users.getLoggedInUser()
      def issueParams = issueService.newIssueInputParameters()
      issueParams.setSkipScreenCheck(false)
      issueParams.addCustomFieldValue(10331, 'textusingscript_false')
      def validationResult = issueService.validateUpdate(author, issue.id, issueParams)
      if (validationResult.isValid()) {
          def issueResult = issueService.update(author, validationResult)
      } else {
          log.error "Error"
      }
      

      4. Check the History of the issue updated (9.12.22) and notice the field "Test Execution Defects" which appears as being updated:

      Scenario using Scriptrunner's HAPI Java API:

      3. Run the below script from Scriptrunner console: 

      def issue = Issues.getByKey('TEST-1')
      issue.update {
          setSendEmail(false)
          setSkipScreenCheck(true)   // <-- This triggers the problem
          setEventDispatchOption(EventDispatchOption.DO_NOT_DISPATCH)
          setSummary("Updated summary test")   // <-- system field setter
      }
      

      4. We can see that a few Xray fields (Test Execution Defects, TestRunStatus) are also shown as modified along with the Summary field, although there is no NEW value present for them.

      DOS investigation summary has been added to the comment section of the ticket (internal). Please refer.

      Expected Results

      The 'Summary' field is only updated as per the script

      Actual Results

      Additional Xray fields are updated along with Summary field.

       

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Unassigned Unassigned
              sthottamkara@atlassian.com Sandhya Thottamkara
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: