Script for automatic transition between the statuses of the workflow.

Thomas April 14, 2021

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

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.

Thomas April 20, 2021

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?

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.
April 20, 2021

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events