Hi all,
I've created a library of useful Automation rules, that can be called from other rules as incoming webhook, using the "Web Request" component.
Is it possible to insert a custom value in the webResponse body of the library rule?
E.g. (just a silly example):
- Let's imagine I create a "library" incoming webhook rule, which takes the current day and calculates the 1st day of next month
- From another rule, I call the first one using Web Request
- Is it possible for the first rule to return to the second rule, in the webResponse, the calculated day?
I mean: without having to store the value in an issue field or comment or similar action.
A typical webResponse includes:
WebhookResponseBean{status=200, statusCategory=SUCCESS, headers={Connection=[keep-alive], Content-Length=[0], Content-Type=[application/json], Date=[Thu, 27 Jun 2024 08:17:51 GMT], Strict-Transport-Security=, [...] body=}
, but for my incoming webHook the body value is always empty.
Best regards,
Federico
Hi @Fede B.
Without seeing your rule specifics, I believe that is possible. For examples showing custom data usage, please see this article on calling the Jira REST API endpoints from a rule using the Send Web Request action:
Please note well: again without knowing the specifics of your rules...if your rules use any form of looping (e.g., branching or callbacks with webhooks) that might be detected as looping and so hit the looping service limit. The specifics of how that limit is detected are not documented well: https://support.atlassian.com/cloud-automation/docs/automation-service-limits/
Kind regards,
Bill
Hi @Bill Sheboy
Thanks for your answer.
Unfortunately, that article only explains how to access a webResponse using the json notation, e.g. webResponse.body.name.
As far as I understood until now, Automation rules of type "Incoming webhook" do not allow to customise the response they return, so this leaves me with the only (bad) solution of writing the "1st day of next month" value in some jira custom field.
In Jira DC I could have replaced the second automation with a ScriptRunner REST endpoint with a customised response, but in Cloud we don't have this option either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please this article on a dynamically looping rule using an incoming webhook trigger for an example of passing and consuming custom data:
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,
Very interesting article, thanks for sharing it. I got more or less to the same conclusion when writing 'cascade'web request/incoming webhook rules. I found out it was easier to call the rule itself, instead of duplicating it.
But still it doesn't provide a way to customise the response body of an incoming webhook 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.