From Jira Automation, we'd like to pass values back from calling Scriptrunner. (I have various scenarios where I want to do this, the most common of which is to call an external REST API and deal properly with error codes. A4J aborts any automation on receiving a 404.)
Ideally return values established in Scriptrunner are made available to Automation. I want to keep it as Automation's job to edit the issue so it's clear to the casual nocoder what is going on.
Is this possible? I'm on DC.
Thanks,
Martin
So it looks like the right way to do this is to define a REST endpoint and call that from a waiting WebHook in Jira Automation. (Kudos to @Tom Hudgins on Need value of automation rule initiator in scriptrunner script for his comment about a workaround.)
Even if there is another way, using REST follows the principles of following an existing standard for communicating between different systems, and keeping things as loosely coupled as possible.
The REST API should be set up to guard for permitted APIs. It could be hosted on AWS Lambda/Forge or ScriptRunner or PowerScripts, depending on how future proof the architecture needs to be.
Of course, it would be nice if Scripting solutions for Jira just wrapped the REST call in quasi parameter and return call semantics. i.e. called REST for us and waits for the answer, passing back values via an unpacked webhook response. As it is, you can invoke only with no sense of instructing behaviour or knowing outcome.
If you only need to call a REST endpoint to setup a webhookResponses smart value list to use in later scripts, you can do a GET web request to http(s)://your.jira.host/status.
This is a very quick call which requires no authentication and avoids the need to set up a separate REST endpoint in scriptrunner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seems like the values are set by side effect.
So relying on it could break silently down the road.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That said, I'll play with this - I suspect I passed judgement too quickly.
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.