"Create a sub-task. Will optionally reopen a matching sub-task." not working, but I do not change the summary

As the title says,  

"Create a sub-task. Will optionally reopen a matching sub-task." is not working, but I do not change the summary via scripts, and the Subtask Summary field is set.

I followed this previous question

https://answers.atlassian.com/questions/314926

But as I mentioned, the Subtask Summary field is not changed, and does exist, so that answer does not help.

Groovy Script Runner version 2.1.17
Jira version 6.2.7
Jira Agile version 6.6.0

Additional issue actions

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.crowd.embedded.api.User
userManager = (UserManager)  ComponentAccessor.getUserManager()
MutableIssue issue = issue
def cf_1 = customFieldManager.getCustomFieldObjectByName('Campaign Manager')
User usera = userManager.getUser(issue.getCustomFieldValue(cf_1).getUsername());
issue.setAssignee(usera);

Subtask Action: is blank

Thanks in advance for the assistance.

3 answers

1 accepted

This widget could not be displayed.

The subtask action can't be blank - it needs to know which transition to do on it. 

I guess the script title is not the most accurate. What it means to say, is that it will optionally do some action on the child, maybe because you want to keep it in sync with the parent state, for instance reopen it.

Blank means you are choosing the option not to do any action on the subtask. 

Sorry, I missed this on first read.

Edit - I need to update a few of the descriptions... some of them are ambiguous, and this one is just plain confusing.

 

This widget could not be displayed.

That was not a solution I expected.  Thank you very much for your help!

This widget could not be displayed.

@Jamie Echlin [Adaptavist]

Trying to do this, reopen a sub-task from a resolved parent - all on script page is blank except the existing subtask issue type (Defect) and the Sub-Task action which is the transition I expect to fire. It keeps creating a new sub-task ... What am I missing??

 

Groovy Script Runner version 2.1.17
Jira version 6.4.11, 5.1

Sub-Task Action: Schedule and Move to Dev Team (331)

(This transition is listed on the child issue)

Part of the problem is the summary is going to change for every single issue - it won't be the same for each issue, so the example in the scriptrunner tutorial doesn't really work for us.

I also tried Reopen (31) with the same result.

https://scriptrunner.adaptavist.com/4.1.3.5/jira/builtin-scripts.html#_create_a_sub_task

It will only work with a hard-coded summary. If you don't have that you will need to write your own script to reopen the subtask... which will have to include knowing which subtask to reopen, if more than one.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

181 views 2 0
Join discussion

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