Run a script after the issue transitions through "triaged" state

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.
February 18, 2021

I have written a script that I want to run when the user triages an issue. When the user presses the triage button on the triage screen in Jira. Below is the mentioned button.

I want to update the Due Date.
**question**
Where can I add the listener for this in Script runner? Any ideas? Thanks a lot

OnPaste.20210218-155834.png

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2021

Listeners with SR are done via Admin -> Scriptrunner -> Listeners.

I am not sure you want a listener here though.  Listeners react to events, not actions in the workflow directly.  A listener would only work in this case if your "triage" transition fires an event of the type the listener is listening for.

I would suggest looking at a post-function on the triage transition.  They're easier to write than listeners and you know that they will be, and only be, run when the button is clicked.

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.
February 18, 2021

You're right. A listener will not work in this case. How do I add post function to the triage transaction? I hace a script ready to add and is working in SR console but not finding a place to put it to run. Would you please mention where should I add post function for it? Thanks 

Suggest an answer

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

Atlassian Community Events