Forums

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

Need help with JMWE conditional execution - Transition Parent issue based on sub-task status

Aisha M
Contributor
October 25, 2018

I am trying to create a conditional update of the parent of a sub-tasks to move to “Working” when the sub-tasks moves to “Working”. 

The conditional statement would be to not transition the Parent if the Parent is in Testing, Ready to Accept, Accepted, or Done.

Can someone help with the syntax for the Conditional execution in JMWE. Thank you

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
October 25, 2018

Hi,

you didn't specify whether you're on Jira Server or Jira Cloud.

Also, why do you need a condition on the parent issue's status? Is the Start Working (or whatever the transition you're triggering on the parent) a global transition? Why not make it a regular transition if it should only apply to a single source status?

Anyway, on Jira Server, using JMWE for Jira Server, the condition would be:

! ["Testing", "Ready to Accept", "Accepted", "Done"].contains(parentIssue.getAsString("status"))
Aisha M
Contributor
October 25, 2018

@David Fischer Hi David. Thank you for the reply !

And yes, its JIRA Server.

The above is a requirement that has been requested from out users (post approval from scrum masters). So, trying to get this done using JMWE add-on, as it seems simple.

Also, where would you advise I place this post function (which transition ?), if I want to automatically move the parent to "working" when one of the sub-task is moved to "working".

Also, thank you so much for the syntax. Will try using it and see if I m able to get it to work.

David Fischer
Community Champion
October 26, 2018

You need to add the post-function on the “to working” transition (you didn’t specify its name in your question) of the subtasks’ workflow. The post-function will need to be configured with the name or ID of the transition to trigger on the parent issue (e.g. “to working”) - not the _status_. 

First make it work without the condition, then add the condition. 

Aisha M
Contributor
October 29, 2018

@David Fischer Our workflow follows the below statuses David,

To Do - Ready to work - Working - Testing - Ready to Accept - Accepted (Only Product owners can make this transition) - Done

The above is an example of how a typical workflow is for my project

David Fischer
Community Champion
October 29, 2018

These are statuses, not transitions. You need to use transition names or IDs. 

Aisha M
Contributor
October 29, 2018

@David Fischer Well, the transitions we have are,

Create

Ready to accept

Accepted

Done

So, where do you think I need to place the JMWE condition. I placed the condition you had mentioned at the Create transition and it doesn't work (When the sub-task moves to 'working', it does not change the story to 'working'. Thanks

David Fischer
Community Champion
October 29, 2018

As I mentioned earlier, you should first try without the conditions, to make sure the post-function is configured correctly. Did you?

Aisha M
Contributor
October 29, 2018

@David Fischer IT WORKED ! Thank you so much !!! 

0 votes
Tom Lister
Community Champion
October 25, 2018

Hi @Aisha M

try

def statusList = Arrays.asList("Testing", "Ready to Accept", "Accepted", "Done")

statusList.contains(parentissue.get("status"))

Aisha M
Contributor
October 25, 2018

@Tom Lister 

Hi, Thank you for the comment !

So, I tried adding a post function at the "working" transition of the workflow to change the status of the parent to working when the sub-task is moved to working, along with the above statement you had provided.

Still does not work. Any thoughts on this ? Thank you

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events