Uploaded image for project: 'Automation for Jira Server'
  1. Automation for Jira Server
  2. JIRAAUTOSERVER-527

The "Please select a valid project" error is triggering while trying to publish the automation rule

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 8.0.3
    • Actions
    • Severity 3 - Minor
    • 1

      Issue Summary

      While trying to publish the rule which has "Create Issue" action, the activity will fail in case current user (account under which you are logged in) doesn't have Create Issues permission for the action's target project. This will happen even if both rule's Owner and Actor account has this permission available.

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. Create two separate user accounts that would be further used as the rule's Owner and Actor. Please make sure that these accounts are different from your current user.
      2. Create new or edit the existing project's permission scheme to set the following access rights:
        • Current user: should have Browse Projects permission
        • Owner and Actor account: should have Create Issues permission. Don't grant this permission to Current user.
      3. Login under Current user and create a new automation rule (this account is expected to have the necessary permissions granted to create rules).
        • Set Owner and Actor account accordingly at rule details.
        • Add the "Create Issue" action and select the project which has the above-mentioned permission scheme configured.
        • Try to publish created rule — action will fail with the "Please select a valid project" error and HTTP 400 error.

      Expected Results

      Since the rule will be executed under Actor account, permission should be verified against this account and not against the currently logged user.

      Actual Results

      In case currently logged user doesn't have Create Issues permission for the project, it will be not possible to publish the rule that expects to create new issues there (even if Actor account has all necessary permissions)

      The HTTP 400 error is observed while sending a request:

      PUT http://localhost:9001/9001/rest/cb-automation/latest/project/GLOBAL/rule/9
      
      Response:
      {
          "errorMessages": [],
          "errors": {
              "component:207": {
                  "project": "Please select a valid project."
              }
          },
          "status": 400,
          "warningMessages": []
      }
      

      Workaround

      Grant current user Create Issues permissions to the current user who creates the automation rule. The permission could be granted temporary and revoked after the rule will be successfully created and published

        1. 1_publish_rule_error.png
          498 kB
          Alexander Artemenko
        2. 2_permissions-1.png
          388 kB
          Alexander Artemenko

              Unassigned Unassigned
              e7e12f16f891 Alexander Artemenko (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated: