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

Behaviour Workflow Action Condition gets incorrectly triggered in Issues with different Workflow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Triage
    • Low
    • Resolution: Unresolved
    • 6.55.0
    • None
    • Behaviours
    • None
    • 2.7

    Description

      When using Workflow Action Condition in Behaviour, it seems it is getting incorrectly triggered in mapped Issue that is using a different Workflow than the one set as the Guide Workflow. It seems that the Condition is being triggered based on the Action ID, so it also gets triggered in Issues with different Workflow but shares the same Action ID.

      Steps to Reproduce

      1. Create a new Behaviour and map it to all Projects and Issue Types
      2. Add a Workflow as the Guide Workflow (e.g.: Software Simplified Workflow for Project ABC)
      3. Add the Issue Type Field into the Behaviour, set the following configurations:
        • Enable 'Hidden'
        • Add Conditions: Except > Workflow Action > Create
          You can use any Workflow Action that shares the same Action ID as other Workflow
      4. Ensure the Project is using a Workflow Scheme where the Sub-task is using a different Workflow than the other Issue Types
      5. In any Issue Type other than Sub-task, check that the Issue Type field is only shown in the set Condition. In this example, it should only appear when in the Create Action/Transition. Others would have the field hidden.
      6. Now check in the Sub-task Issue Type

      Expected Behaviour

      In Sub-task Issue Type, the Issue Type field will always be hidden, as it will not meet the 'Except' Condition since it is using a different Workflow

      Actual Behaviour

      The Sub-task Issue Type will have the Issue Type field shown when in the Create Action/Transition, despite it using a different Workflow.

      Replication video: BehaviourWorkflowActionConditionBug.mp4

      Workaround

      Rather than using the Condition, in the field server-side script, use getActionName() to fetch the Action/Transition name and use it as a Condition in an IF-ELSE statement:

      def action = getActionName() as String
      def field = getFieldByName("Issue Type")
      
      if (action == "Create" || action == "To Do"){
          field.setHidden(false)
      }else{
          field.setHidden(true)
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              imazuki Irfan Mazuki
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: