"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

2 votes

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.

 

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

@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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

246 views 4 10
Read article

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