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
Community Members
Community Events
Community Groups

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
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

228 views 0 6
Join discussion

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