Create fast track transition on subtask type with Groovy

Is there a way to create a fast track transition on any type of subtask? I tried type in subTaskIssueTypes(), but it failed. The example issue.issueTypeObject.name == 'Bug' is not helpful, it would mean one post function for every type of subtask.

Any other way possible?

1 answer

1 vote
Henning Tietgens Community Champion Jan 29, 2014

try issue.issueTypeObject.isSubTask()

Thanks! Works perfectly :-)

Is there somewhere a list of valid functions?

Henning Tietgens Community Champion Jan 29, 2014

A good entry point is Atlassian API Reference

I tried something similar with a task (not subtask) - what would be the function?

Henning Tietgens Community Champion Jan 29, 2014

I don't know if I understand your question... to identify a Task you could use issue.issueTypeObject.name == 'Task'

OK, my question wasn t very precise. I have a transition that should only be valid for tasks, not subtasks. The condition all subtasks closed is not enough, as it also accepts subtasks, so I wanted to add a condition on the different task types, without writing it for every one individually.

Henning Tietgens Community Champion Jan 29, 2014

You can combine any from the above mentioned condition by "||" (or).

def issueType = issue.issueTypeObject
return (!issueType.isSubtask()) || issueType.name == 'Task')

Or you can create an array of valid issue type names.

['Task','Question','Bug'].contains(issue.issueTypeObject.name)

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

852 views 2 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you