Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Community showcase
Published in Apps & Integrations

Partner Webinar Opportunities: January 2022

Hi everyone 👋, I really like the format of the webinar opportunities summary that @Jimmy Seddon posts monthly on the Welcome Centre group. It's a great place to go to check that you didn...

139 views 3 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you