Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,753
Community Members
 
Community Events
168
Community Groups

Script for automatic transition between the statuses of the workflow.

Hi Community,

I'm asking for your help to create a script for Adaptavist ScriptRunner, which will perform the transition of statuses in the workflow. I ask those of you who have experience and knowledge in writing scripts. I'm new to this and don't know how to do it.
I need a script that will perform the transition between statuses in a workflow (it should execute for all projects in Jira). The logic is as follows:

WHEN Comment added -> IF Issue matches Status = "A”; Comment is public; User is an agent; Comment is primary action -> THEN Transition issue “A1”

ELSE IF Issue matches Status = "B”; Comment is public; User is not an agent; Comment is primary action -> THEN Transition issue “B1”

ELSE IF Issue matches Status = "C”; Comment is public; User is an agent; Comment is primary action -> THEN Transition issue “A1”

Maybe some of you already have similar templates. I will appreciate your help very much.

PS. I know that such automation rule can be created with standard Jira tools, but I have a hidden transition in a workflow that can be triggered from other applications (e.g. ScriptRunner).

Condition to transition.jpg

1 answer

1 accepted

1 vote
Answer accepted

Here's how to do a transition in a listener that listens for all comments - https://library.adaptavist.com/entity/transition-an-issue-when-a-tm4j-test-execution-is-updated  - it's for test management and only does one transition, but all you'll need to do is change the logic so that it can trigger A1 or B1 instead conditionally instead of always trigger the same one.

Thank you very much for the link, but when I go to it, I get a 404 error - this page does not exist. Could you please check the correct address?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events