Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

tomgross_com
Contributor
August 23, 2023

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 Champion
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

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 Champion
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

Atlassian Community Events