Hi,
I'm trying to create an automation rule to get some data from one of ours servers. I managed to have a happy path - when all connections work... But from time to time "something happens" and I get an error (and I nee to have a different behavior for it).
I see in the audit log the error, but I can't get the data in webhookResponse. WebhookResponse has the values from the last (successful) call
To handle errors and different behaviors based on the response of your web request in Jira Automation, you need to set up conditional logic within your automation rule. Since Jira’s native automation capabilities might be limited in handling complex error scenarios, leveraging webhooks with proper error handling in combination with ScriptRunner might be more effective.
However, within Jira Automation itself, you can set up a basic structure to handle different responses. Here’s a high-level approach to guide you through setting this up:
Step-by-Step Guide
1. Set up your Automation Rule:
• Go to Project Settings > Automation.
• Create a new rule with the trigger that suits your needs (e.g., Issue Created, Issue Updated, Scheduled).
2. Send Web Request:
• Add the action to send a web request to your server.
• Configure the web request with the necessary details (URL, headers, etc.).
3. Check for Webhook Response:
• Add a “Log action” to log the response for debugging purposes.
• Use the “Advanced compare condition” to check the response status and body.
Example Rule Configuration
Trigger:
• Issue Created or any other appropriate trigger.
Action:
• Send Web Request to your server.
Log Action:
• Log action to capture the webhook response.
Advanced Compare Condition:
• Check the response status and handle errors.
Hi @Caio Covos
Thank you for your reply. This are exactly the steps that I have followed, but I can't get to capture the error message.
I have 2 requests in my automation, one to get a token and then to request I'm interested in.
If you look in the picture, you see I actually get a 555 for my second request, but my response is 200 (from the first).
I've set the second call to wait for the response, and in this situation it 'freezes' there, no logging for second call.
Do you have any recommendations?
Thank you,
Anca
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get the same behaviour. I can capture the value of {{webhookResponse}} when the automation returns 200, but if it doesn't the automation errors out on the webook.
I.E.: the automation terminates immediately when there is an error, so nothing further can be logged, nor can any conditional logic be applied to result.
This looks like a bug. Does anyone have a solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I have the same thing here.
I try to insert a catch like this but I wonder that it can be done in Jira DC Automation.
Like the rule is in error dispite the catch/condition maybe we can't manage error like that. Is someone else managed that ?
My rule :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.