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

Behaviours: Setting the Assignee field as required does not work

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.1.6
    • Fix Version/s: None
    • Component/s: Behaviours
    • Labels:
      None
    • Environment:

      ScriptRunner| 5.1.6 |

      JIRA Software| 7.5.0 |

    • Critical Points:
      1.9

      Description

      If you use a Behaviour to set the Assignee field to be required, a red asterisk appears next to the field but it is not truly mandatory; you can still create the issue even if the field is set to unassigned.

      Steps to Reproduce:

      • Create a behaviour
      • Select the Assignee field to add a behaviour to
      • Without the use of any server-side script, set the field to be required
      • Now go to create an issue. Notice the field has a red asterisk, signifying that it is required
      • Fill in the Summary field but set the Assignee field to unassigned, and try to create the issue
      • The issue will create regardless of the field being set to unassigned

      Workaround

      You can use a server-side script to validate that the assignee field is set:

      def assigneeField = getFieldById(getFieldChanged())
      def assignee = assigneeField.value
      log.warn("Assignee: "+assignee)
      
      //Check if assignee is unassigned or automatic
      if(assignee in ["","-1"])
      {
      assigneeField.setError("Please select an Assignee!")
      }
      else
      {
      assigneeField.clearError()
      }

      Attach this script to the assignee field and the error message should stop the issue from being created.

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            aderossett Aidan Derossett
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: