Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-6929

Using variable ${event.user.name} when sending a webhook call with automation with a custom payload do not produce the correct value

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 4.5.0, 4.11.0, 4.5.6
    • Automation

      Issue Summary

      When creating an automation rule to send a Webhook with a custom payload with the variable ${event.user.name}, the variable is not interpolated with any value and is sent empty.

      -

      This bug was reported in Community Questions, at the following question: https://community.atlassian.com/t5/Jira-Service-Desk-questions/Automation-webhook-custom-payload-variables-missing/qaq-p/1408516

      Steps to Reproduce

      1. Create a custom automation rule, with:
        1. WHEN: "Issue resolution changed";
        2. THEN: "Webhook";
        3. Configure the webhook with a test URL;
        4. Select "Send custom payload" as body type;
        5. Add the following to the payload textarea:
          { "user" : "${event.user.name}" }
        6. Confirm;
      2. Before saving the new rule, click in the "Options" link in the upper-right corner, and select "Run as the user who triggered the rule";
      3. Save the new rule;
      4. Add the webhook test URL to the Whitelist (http://PATH_TO_JIRA/plugins/servlet/whitelist);
      5. Trigger the automation rule by resolving an issue.

      Expected Results

      The webhook should be called with a value like:

      {
        "user": "my_user_name"
      }
      

      Actual Results

      The webhook is called without a value for the user:

      {
        "user": ""
      }

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            [JSDSERVER-6929] Using variable ${event.user.name} when sending a webhook call with automation with a custom payload do not produce the correct value

            Kind reminder, any updates for the workaround or ETA for the solution?

            Many thanks!

            Bojana Vasic added a comment - Kind reminder, any updates for the workaround or ETA for the solution? Many thanks!

            We got the same problem with ${issue.assignee.name}, while ${issue.reporter.name} works fine. 

            Deleted Account (Inactive) added a comment - We got the same problem with ${issue.assignee.name}, while ${issue.reporter.name} works fine. 

            I kind of made a workaround for this, for my use case anyway.

            So first I was using webhooks inside of a specific project. However, if you create a global webhook, you will get passed the username/id of whom executed that task in the request args. 

            My case was for a slackbot, so when someone approves inside of Jira the slack message gets updated with the username that I parse. 

            Maybe this'll help some of you.

            Thomas Edward added a comment - I kind of made a workaround for this, for my use case anyway. So first I was using webhooks inside of a specific project. However, if you create a global webhook, you will get passed the username/id of whom executed that task in the request args.  My case was for a slackbot, so when someone approves inside of Jira the slack message gets updated with the username that I parse.  Maybe this'll help some of you.

              Unassigned Unassigned
              esantos2 Elton Santos
              Affected customers:
              11 This affects my team
              Watchers:
              14 Start watching this issue

                Created:
                Updated: