Forums

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

Take Jira ticket data and run custom script after the ticket is solved

Ioannis Benetos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 14, 2022

Hi Community,

I have a case and I am not sure how to handle it. 

we want to run a custom script for each ticket in a one specific project. The custom script should be executed after the ticket closed. The custom script should take the data from the particular ticket and forward the information to a other tool (Datadog). The Datadog part is not the issue. How can I implement a custom script for each ticket with the triggered status of done and get the data from this ticket? 

Hope you understand my behaviour

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Champion
September 14, 2022

Hi @Ioannis Benetos ,

welcome to the Atlassian community!

If you need to execute something custom after a ticket closure, you can setup a custom post function in your close transition.

Post function is something that happens after the transition so, in my opinion, is the best way to do that. You can use ScriptRunner for JIRA (https://scriptrunner-docs.connect.adaptavist.com/jira/post-functions.html#_additional_code) to implement a scripted post function.

Another way is to setup a batch procedure that retrieve all closed tickets and perform your code for each issue.

Hope this helps,

Fabio

Ioannis Benetos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 14, 2022

Hi @Fabio Racobaldo _Herzum_  Thanks for the quick reply! okay and how I get the data from the ticket to use them ? I want to pick the data and forward them to a other tool

Nic Brough -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.
September 14, 2022

A post function has direct access to the issue object against which the transition is being run, so you don't have to write code to ask questions of the issue.

In other words, you can write a post-function that does things like

def email-subject = "Hey, we updated " + issue.getKey() + " " + issue.getSummary()

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