Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Need Workflow Condition to only allow transition based on issue type and status of SubTask (CLOUD)

tomgross_com
Contributor
August 23, 2023 edited

I have the following ScriptRunner script on server that is within a Workflow Condition.

issue.subTaskObjects.any {

it.issueType,name == "QA Sub-task" && it.status.name == "QA In Progress"

}

I need to re-write this for ScriptRunner Cloud and having a hard time figuring this out.  I also have JIRA Misc. Workflow Extensions (JMWE) installed.  I'm really don't care how this is implemented.  Possible through a JIRA Automation in Cloud?

Any help would be greatly appreciated

1 answer

1 accepted

3 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2023

Hi @tomgross_com 

with either ScriptRunner or JMWE (Build-your-own Condition), you can use the following code:

issue.subtasks && issue.subtasks.some(it=>it.issueType.name == "QA Sub-task" && it.status.name == "QA In Progress")

  

tomgross_com
Contributor
August 24, 2023 edited

Worked great.  Thanks!

Where can I find documentation on this solution.  Looked everywhere for "Subtasks.Some" can can't find anything.  Is this part of groovy syntax?  Finding it really difficult to find examples on the object model and how to navigate properties in the cloud

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 24, 2023

The thing is, on Jira Cloud, you cannot use Groovy. Jira Cloud uses its own language called "Jira Expressions" for Conditions and Validators (and JMWE Cloud uses Nunjucks for post-functions, but that's JMWE-specific).

You can read more about Jira Expressions here: https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/455180360/Using+Jira+Expressions

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Upcoming Jira Events