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,
Serj
Hi @Sergey
To access the smart values for any created issues in the rule, you may use one of these methods:
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I understand that issue is null, so parsing the webhook body remains.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
#2) Capture the data you need in Created Variables and then use those in the Script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
A solution was I found. I can find the values like this:
, where {{remoteKey}} is smart value variable
Thank you very much for joining us in resolving this issue. Good luck!
Kind regards,
Serj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.