Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Autimatuon. Use Send Web Request after Incoming webhook

Sergey November 1, 2025

Hi,

I found that the Automation trigger for ticket creation does not work when the ticket was created via Incoming webhook, so I cannot apply a web request for this event.
I tried to send a web request in the Incoming webhook rule, but how do I correctly specify the values of the created ticket in the webhook body Custom data? Please help.

Best regards,

Serj2025-11-01.png

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2025

Hi @Sergey 

To access the smart values for any created issues in the rule, you may use one of these methods:

  1. For the most-recently created issue, use {{createdIssue}} and its attributes
  2. For all of the issues created up to that point in the rule, use the plural {{createdIssues}} and their attributes
  3. You may also branch to either the most-recently created or all created issues, and then access each one using {{issue}} and its attributes

Your rule is trying to use the Issue Data as the Webhook Body, so the #3 branching approach matches your needs

If instead you want to use a custom data message for the endpoint call, I recommend using a Create Variable action to first build the JSON message and use the variable in the action.  This will reduce the chance of timing problems in the Send Web Request action.

 

Kind regards,
Bill

Sergey Karaev November 1, 2025

Thank you very much, Bill, you've been a great help! Could you also tell me how to use webhook values in Execute a ScriptRunner script. The ticket is not being created. I tried use ruleContext but I get null 

I tried parsing, but I get an error

def requestBody = new JsonSlurper().parseText(webhookBody)

Best regards,

Serj

2025-11-01-2.png

Sergey Karaev November 1, 2025

I understand that issue is null, so parsing the webhook body remains.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2025

Hi @Sergey 

I am not using ScriptRunner currently and cannot offer tested suggestions, and...

 

First thing to check: smart values are name, spacing, and case-sensitive.  I notice your script capitalizes Summary, but the smart value for that field is:

{{issue.summary}}

Please change that, and check any other smart values to confirm they are correct.

 

If that does not work, I wonder if the {{issue}} smart value from the trigger is not available in the same way to the ScriptRunner action.  You could check that in two ways, trying them one at a time:

#1) Add a branch to current issue:

  • trigger: incoming webhook (with your issue data)
  • branch: to current issue
    • action: run the ScriptRunner script

 

#2) Capture the data you need in Created Variables and then use those in the Script

  • trigger: incoming webhook (with your issue data)
  • action: create variable
    • variable name: varSummary
    • value: {{issue.summary}}
  • ...add more variables for other data needed by the script
  • action: run the ScriptRunner script
    • changing any references of {{issue.summary}} to {{varSummary}}
    • ...

 

Sergey Karaev November 1, 2025

Hi Bill,

thanks for your reply. I did that, created a log after Incoming webhook, and I can see the correct variable value in the log, but when I use it in the script, I get something like Script22$_run_closure1@523b1669.

 

0 votes
Sergey November 1, 2025

Hi,

Sorry, I found that the rule works when "Allow rule trigger" is enabled. But the question remains about using Custom Values in Send Web Request in the same rule. Has anyone had a similar experience?

Best regards,

Serj

Sergey Karaev November 1, 2025

 Hi @Bill Sheboy ,

A solution was I found. I can find the values like this:

def issuekey = ruleContext.renderSmartValues('{{remoteKey}}'
or
def issuekey2 = ruleContext.renderSmartValues('{{webhookData.key}}')

, where {{remoteKey}} is smart value variable

Thank you very much for joining us in resolving this issue. Good luck!

Kind regards,

Serj

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events