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

Description field template configured using behaviour is not reset if the project is changed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 5.6.2
    • Fix Version/s: 6.25.0
    • Component/s: Behaviours
    • Labels:
    • Sprint:
      SR4J Sprint 86, SR4J Sprint 87, SR4J Sprint 88, SR4J Sprint 89, SR4J Sprint 90, SR4J Sprint 91, SR4J Sprint 92, SR4J Sprint 93, SR4J Sprint 94, SR4J Sprint 95, SR4J Sprint 96, SR4J Sprint 97
    • Critical Points:
      10.9

      Description

      Steps to Reproduce

      1. Create a new behaviour and add a project mapping.

      2. Add a default Description template either using the Initialiser or Server Side Code for example

      def desc = getFieldById("description")
      
      desc.setFormValue("") 
      
      def projectObject = issueContext.projectObject
      
      log.warn "=========>>>>>> ${projectObject.name} <<<<<<<<========="
      
      def defaultValue = """Hello World!!!! ${projectObject.name}"""
      
      if(projectObject.name == "MOCK") {
       desc.setFormValue(defaultValue)
      } else {
       desc.setFormValue("")
      }
      

      3. Create a new ticket and select the project configured for the behaviour. As expected the default description template is displayed. 

      4. Now in that same create screen change the project selected

      Current Behaviour

      When the project is changed, the Description field template that was displayed for the previous project in which the behaviour was configured is still displayed.

      Expected Behaviour

      The Description field should only show the default template for projects that have it configured in the behaviour, else the Description field should be empty.

      Workaround

      1. Create a new Behaviour configuration and include all the projects that do not require the default description template into the mapping. If you do not want to do this approach i.e. add all the projects into one behaviour config, you can also set it for each project initialiser separately.
      2. Add the code below to the Behaviour Initialiser to clear description i.e.

      def description = getFieldById("description")
      if(actionName == "Create") {
       description.setFormValue("")
      }
      

      Additional Information

      A video to display this behaviour is included for reference.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aserrano Andre Dario Moreira Serrano
              Reporter:
              rkumar Ram Kumar Aravindakshan
              Votes:
              7 Vote for this issue
              Watchers:
              19 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: