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

"Send Custom Email" Canned script getWorkflowButtons.call closure returns incorrect workflowId for the Workflow Buttons

    Details

    • Type: Bug
    • Status: Done
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 5.4.43
    • Fix Version/s: 5.5.0
    • Component/s: None
    • Labels:
    • Critical Points:
      1.5

      Description

       

      It appears that the closure we provide for users to get the workflow buttons returns an invalid URL in certain circumstances.

      The closure I refer to is the

      ${getWorkflowButtons.call()}

      that users can select from our examples list under the "Email Template" script field within the "Send a Custom Email" Canned Script.

       

      We currently get the issue.workflowId and use it as the id variable to create a URL like this for the workflow buttons.

      http://localhost:8080/jira/secure/WorkflowUIDispatcher.jspa?id=10007&action=21&atl_token=BWP3-NZB2-6EDY-6C7K_af1f979b1717b6184819ceffcea8032e0ca6381f_lin

      However, it appears we should be using the issue.id here and not the issue.workflowId because although in many cases the issue.workflowId is the same as the issue.id, this is not always the case.

      For example, if you create a basic sample project with 1 workflow you will see the issue.workflowId is the same as the issue.id but if you then create a new basic custom workflow with a few statuses and transitions and add it to this sample project as a second workflow you should see that the issue.workflowId variable used within the ${getWorkflowButtons.call()} is no longer the same as the issue.id and the URL's built for the workflow buttons then stop working

      Regards

      Matthew

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            mclark Matthew Clark
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: