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

Madhura Deshpande June 26, 2017

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

0 votes
Aidan Derossett _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 28, 2017

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
TAGS
AUG Leaders

Atlassian Community Events