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

Wrong data can be cached in Jira while in post function creating issue or changing label custom field value

    XMLWordPrintable

Details

    Description

      Summary

      Jira's Java API for issue create and issue edit executes code that is database transaction unfriendly. This code is about setting label custom field values. During this operation we reset cache storing label values and expect the new ones to be already present in database for loading. Any other thread that will access the cache for created/edited issue during the transaction will load the data without uncommitted part.

      Steps to reproduce

      Notice

      Steps to reproduce include 3rd party apps that show example of Jira API usage that causes the problem. If you are aware of this behaviour causing problem in Jira without 3rd party apps please let us know in issue comment.

      1. Setup Jira 7.10.1
      2. Install Exocet 2.15.1
      3. Install Automation for Jira 3.13.10
      4. Setup 2 projects: "Project A" and "Project B"
      5. Setup a custom field of type "Labels" globally
      6. Configure Exocet field mappings to copy this "Labels" custom field:
        1. Go to "Administration" -> "Add-ons" -> "Exocet" -> "Configuration"
        2. Switch tab to "Fields mapping".
        3. Click "+Add" button.
        4. Set "Name" field and add "Field to field" for copying "Labels" custom field created earlier.
        5. Click "Save" button.
      7. Configure an Exocet operation to create a new issue in "Project B":
        1. Go to "Administration" -> "Add-ons" -> "Exocet" -> "Configuration"
        2. In tab "Operations" click "+Add" button.
        3. Set "Name" field
        4. In tab "Target" of "Create a operation":
          1. Set "Project" to "Project B".
          2. Set "Issue type" and "Link" fields to any available option.
          3. Set "Fields mapping" to one created earlier.
      8. Add configured Exocet operation as a post-function in any workflow transition for "Project A"
      9. Configure an Automation for Jira rule triggered by an issue event:
        1. Go to "Administration" -> "System" -> "Automation for Jira" -> "Automation rules"
        2. Click "Create rule" button.
        3. As a trigger pick "Issue commented"
        4. Select "New action" -> "Log action".
        5. Type anything into "Log message" and click "Save" button.
        6. Set anything in "Name your automation..." field and click "Turn it on".
      10. Create issue "Issue A" in "Project A" with values in "Labels" custom field.
      11. Transition "Issue A" in "Project A" using the transition you added the Exocet post-function to.

      Expected result

      A new issue is created in "Project B" with all of labels from copied issue.

       Actual result

      A new issue is created in "Project B", however the labels custom field appears to not have any values.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pczuj Przemyslaw Czuj
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: