Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,556,764
Community Members
 
Community Events
184
Community Groups

workflow custom script validator

Edited

Hi All,

 

Q.) for Task issue type while moving to close transition in workflow: 
      Error would be displayed if the task have any open subtasks. (open meaning issue not in any done status category)
      Error Message: "All open subtasks needs to be closed"
    > I have written this script , but it is not working.
       import com.opensymphony.workflow.InvalidInputException;

        if (issue.getSubTaskObjects().any { subtask -> subtask.getIssueType().getName() ==               'Task' && subtask.getStatus().getName() != 'Done' })
       {
        throw new InvalidInputException("All subtasks need to be closed");
        }
         Where we need to change?

1 answer

0 votes
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.
May 15, 2023

I wouldn't bother with a script.  There's a built-in condition for "only allow transition if all sub-tasks are in one (of a list of) status"

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events