Create a subtask in parent issue (sibling subtask) when subtask is resolved

Hey, I am using the Script Post-Function: "Create a sub-task" of the Script Runner Plugin.

I can create Subtasks from the parent issue easily, but how would I create one if a sibling subtask is transitioned?

Thanks in advance.

edit:

I found the following lines in the "Create a sub-task" script, see whole script: http://goo.gl/3sQaKV

def String subtaskAction = params[FIELD_SUBTASK_ACTION]

        subtaskAction = subtaskAction?.replaceAll(/ .*/, "")

        String subtaskSummary = params[FIELD_SUBTASK_SUMMARY]

        if (issue.getIssueTypeObject().isSubTask()) {

            log.warn ("This issue ($issue) is already a sub-task... doing nothing.")

            return [:]

        }

So it already checks if the task itself is a subtask and does nothing if so. In this case I would like to set "issue" to the parent issue, something like issue = issue.getParentIssue(). How would this be possible?

2 answers

1 accepted

This widget could not be displayed.

> In this case I would like to set "issue" to the parent issue, something like issue = issue.getParentIssue(). How would this be possible?

Pretty much like you say. Using the script as a starting point, if it's a subtask, set the issue issue.getParent() or whatever it is.

> You can do it with jjupin

Yeah, you can do it with script runner, or jira scripting suite, or a java plugin, or jjupin.


Okay, I made myself famiiar with groovy and script runner. I think I could modify the script to my needs.

But I dont know where to put the script so it appears in the Script Post-Function overview of the postfuntions in a workflow transition. So I can configure it, specify name of the subtask, etc, like the ones already setup there. Can you help me out there please? thanks in advance.

This widget could not be displayed.

Hi,

You can do it, using JJUPIN plugin.

http://confluence.kepler-rominfo.com/dashboard.action

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

292 views 5 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