Scriptrunner - How to associate a script when an issue transitions from one state to other?

I want to fire a custom script when issue changes its state from say "to-do" to "in process".

I am able to create a new event listener, and fire that script on issue"create" event, but not on above event, the way I want it.

I tried adding custom events, but was not able to do so properly either :(

Is there a tutorial or documentation that I am not able to search, on how to do this?

1 answer

Hey Madhura,

It sounds like to me that a custom workflow function would work best for you. We have some information on those in our documentation here. Specifically, I think that you'd be best off using a scripted custom post-function. I'll give you a quick rundown of the process:

  • Edit desired workflow
  • Click to diagram view (not necessary but helps with visualization)
  • Click on the transition that you would like to add the post function to
  • A pop-up menu will appear to the right side of the screen. Click the 'post-function' link.
  • Then choose to add a new post function.
  • From here you select a scripted post-function and then you are able to choose from a selection of built-in functions or to make a custom one.
  • After adding the function, ensure that it is appropriately placed in the order of execution and publish your workflow.

Another possibility would be to create a listener that fires on a Generic Event and then check to see if the status was changed and what it was changed to etc... However, the first option I provided is the most straight-forward.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


244 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you