Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,467,278
Community Members
 
Community Events
177
Community Groups

Returning values from Scriptrunner to Automation

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

1 answer

1 accepted

2 votes
Answer accepted

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.

Like Martin Cleaver likes this

Seems like the values are set by side effect.

So relying on it could break silently down the road.

That said, I'll play with this - I suspect I passed judgement too quickly.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events