The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Need Workflow Condition to only allow transition based on issue type and status of SubTask (CLOUD)

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events