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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to programmatically register a Service?


I recently saw this question somewhere but now I cannot find it anymore, so please bear with me.

I have a ScriptRunner Script that will execute REST-calls against a backend. Now I possibly need a single call to be repeated, e.g. because the connection attempt failed. For this, I'd like to register a service to be executed at a single time (preferably once, but I suppose if I can register it, I can also de-register it). Preferably I'd also like to be able to pass parameters to that Service, namely the IssueEvent that triggered the script in the first place. Thus, I have the following questions:

  • How can I programmatically, from inside a Groovy script executed by a Listener, register a Service?
  • Can I pass arguments to this Service, so it has access to a specific IssueEvent?

I could solve this by registering a new custom-field and modifying it in case a script fails, but this will put me in a situation where I cannot determine certain parameters I need. The best solution would be to have a Service that receives the very same IssueEvent and especially its changelog.

Thank you in advance :)

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

78 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you