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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.