Uploaded image for project: 'Automation for Jira Server'
  1. Automation for Jira Server
  2. JIRAAUTOSERVER-508

The FieldChange smart value does not resolve correctly on issue creation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.4.2
    • Actions
    • Severity 3 - Minor
    • 0

    Description

      Issue Description

      The value changed trigger generates odd behaviour when evaluating the smart values fieldChange.toString on issue creation, whereas on issue updated the behaviour is correct.

      Steps to replicate

      1. Create a new custom field (for example, a select list field)
      2. Create a new automation rule as follows:
        • Using the trigger Field value changed
        • Using the action Edit issue, using the following smart value to copy the value of the changed field into another field:
          {{fieldChange.toString}}
          

      3. Try to set the value of the custom field using the 2 method below
        • Method 1: Create a new issue issue and set the custom field value on the create issue screen
        • Method 2: Create a new issue (without setting the value yet). After the issue is created, set the field to a value from the View issue or Edit issue screen

      Expected results

      The automation rule should work successfully with both methods, and the new field value should be copied over to the other field

      Actual Results

      The automation fails with Method 1.

      Instead of getting the proper value, the smart value fieldChange.toString returns a full JSON payload and the automation rule fails with the following error:

      Could not convert the field value to a number. Please ensure the value is a number, math expression or smart-value that can be converted into a number.
      Story Points: {self=http://localhost:8081/jira8201/rest/api/2/customFieldOption/10503, value=5, id=10503, disabled=false}
      

      Workaround

      Instead of using fieldChange.toString in the Edit Issue action, use issue.customfield_XXXXX, as shown in the screenshot below:

      To get the ID of the custom field, go to ⚙ > Issues > Custom Fields, try to configure the custom field and get the ID from the URL in the browser.

      Attachments

        1. Workaround.png
          Workaround.png
          81 kB
        2. IssueReplication_2.png
          IssueReplication_2.png
          197 kB
        3. IssueReplication_1.png
          IssueReplication_1.png
          71 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrey Julien Rey
              Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: