Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-61406

The "User Is In Any Role" Condition is not detected when deleting a role, breaking the workflow





      Roles used in a workflow condition "User Is In Any Role" do not show up when checking where the role is used. If the role is deleted the Conditions that used it are broken and cannot be edited.


      Verified in JIRA 6.4.13.

      This bug does not occur in JIRA 7.0+ because the "User Is In Any Role" condition has been removed.

      Steps to Reproduce

      1. Create a new role called "Bugtest" at Administration > System > Roles
      2. Create a new project, a new workflow, and make the project use this workflow.
      3. In the new workflow, go to a transition and click "Add condition"
      4. Select the "User Is In Project Role" and click "Add".
      5. For "Project Role" select the "Bugtest" role.
      6. Back at Administration > System > Roles click "View Usage" for the "Bugtest" role. The new workflow will be shown in the list of uses of this role.
      7. Edit the workflow, edit the transition, remove the condition.
      8. Add a condition using "User Is In Any Role" and add two roles (the "Bugtest" role and any other one)
      9. Publish the changes to the workflow.
      10. View usage, the workflow won't show

      Expected Results

      View usage for the "Bugtest" role should show the workflow that references it in the Condition.

      Attempting to delete the role should warn that it is used in a project and workflow.

      Actual Results

      The workflow does not appear in the list of workflows using this role and an incorrect message is shown: "This project role is not associated with any notification schemes, permission schemes, issue security schemes or workflows."

      The role can be deleted, JIRA does not warn that this role is used by a project and a workflow. If it is deleted it is removed from the workflow Condition.

      After deleting the role, attempting to edit the Condition that was using it results in an exception and the Condition cannot be edited.

      2016-06-10 15:37:41,681 http-bio-8583-exec-14 uri:/djira/secure/admin/views/wor...ansitiondescriptorparams.jsp username:admin ERROR admin 937x1334x1 1g1myj6 /secure/admin/workflows/EditWorkflowTransitionConditionParams!default.jspa [webwork.util.ValueStack] query="/descriptorHtml" {[id="null" type="5" values=""]} {[id="descriptorHtml" type="8" values=""]}
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at webwork.util.ValueStack.findValue(ValueStack.java:216)
      	at webwork.view.taglib.WebWorkBodyTagSupport.findValue(WebWorkBodyTagSupport.java:62)
      	at webwork.view.taglib.BasicPropertyTag.doStartTag(BasicPropertyTag.java:54)
      	at org.apache.jsp.secure.admin.views.workflow.editworkflowtransitiondescriptorparams_jsp._jspx_meth_ww_005fproperty_005f5(editworkflowtransitiondescriptorparams_jsp.java:1292)
      Caused by: java.lang.NullPointerException
      	at com.googlecode.jsu.util.WorkflowUtils.getStringRole(WorkflowUtils.java:1112)


      No workaround has been identified at this time. The solution is to upgrade to JIRA 7.




            Unassigned Unassigned
            mknicely Morgan Knicely
            0 Vote for this issue
            1 Start watching this issue