Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-6143

Request form not being updated when removing required option from custom field

    XMLWordPrintable

Details

    Description

      Summary

      when changing the  required option for a custom field used for a request form,  AO_54307E_VIEWPORTFIELD isn't being updated (the cache doesn't appear to be cleared either, therefor you get this error:

       

      This is similar to JSDSERVER-5782 but different as you're not deleting the custom field just changing the required option:

       

      Steps to reproduce 

      1.  Create a new custom field.
      2. Set the custom field to be Required.
      3. Add the custom field to a service desk screen 
      4. Add the Custom field in the Request type field. (Project Settings > Request types > Edit fields > Add field > Select (Custom field).
      5. Set the custom field to Optional
      6. remove the custom field from the service desk screen
      7. try to edit the request type fields

      Expected Behavior

      Service Desk will now allow you to remove the field

      Actual Behavior

      Service Desk throws an error "Cannot delete a field that is required by Jira or Jira Service Desk."

      Cause

      When the custom field is set to optional the REQUIRED field in AO_54307E_VIEWPORTFIELD table isn't being updated for the request type:

      Workaround: 

      1. Run below SQL to list out the Request types in the Service Desk
         SELECT * from "AO_54307E_VIEWPORTFORM";

        Take note of the ID of the affected request types

      2. Run below SQL to list all the field in the request type affected.
         SELECT * FROM "AO_54307E_VIEWPORTFIELD" where "FORM_ID" = <ID from Previous query>;
      3. Update the deleted custom field value and set the required value to 'f'
        UPDATE "AO_54307E_VIEWPORTFIELD" SET "REQUIRED" = 'f' where "ID" =<ID for relevant custom field>';
      4. Either restart JIRA OR to clear the Request form cache simply navigate to another Service Desk project and edit and save a Request Type that is NOT using the same screen as the affected project, this should flush the Request form cache. 

       

       

      Attachments

        1. screenshot-1.png
          screenshot-1.png
          91 kB
        2. screenshot-2.png
          screenshot-2.png
          69 kB

        Issue Links

          Activity

            People

              agoldthorpe Aidan Goldthorpe
              rvolkmar Ronnie Volkmar
              Votes:
              11 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync