Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add a post request to an issue when it is updated

Jamshaid
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.
November 2, 2020

I want to run a post function when the update button available on an issue is pressed. How do I do that? I am not finding a way to do it. is there any way I could do it? I am already having the script running in the script runner console but do not know where to put that script.   

Thanks
here are the steps I will be taking

sample.png

 

1 answer

1 accepted

0 votes
Answer accepted
Dirk Ronsmans
Community Champion
November 2, 2020

Hi @Jamshaid ,

A postfunction would be running when you do a state transition. Since you are doing an "update" and not a state transition you can use "Script Listeners"

There you can define on what event it needs to fire the script. For you that would be the "issue updated" event. (and fine tuned with a JQL so it doesn't fire each time)

Jamshaid
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.
November 2, 2020

thanks @Dirk Ronsmans for the answer. Could you please show me a bit detailed sequence about how do i get there where you are mentioning

Dirk Ronsmans
Community Champion
November 2, 2020

You can find the script listeners (you mentioned you have the scriptrunner console so I assume you have scriptrunner installed) in the options of scriptrunner.

When you go to Apps - Scriptrunner for JIRA you can see the Script Listeners:

image.png

 

or you can go to:

 

https://[yourenvironmentname].atlassian.net/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/script-events-admin?s=com.onresolve.jira.groovy.groovyrunner__script-events-admin

There you can add a new listener

 

image.png

 

On that listener you can specify when it needs to run

  • the event
  • a condition
  • and your script
Jamshaid
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.
November 2, 2020

thanks a lot. I have got it working now

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events