Hello,
I have a request to create an epic template which includes stories and sub-tasks that can be used over and over again.
Instead of cloning the structure of the template (which would require another plugin) I decided to have an Epic with a specific component that, on creation, launches a script that creates the additional needed stories and sub-tasks and and then links them to the main epic. So far my If statement and createIssue statements work without a problem but I am not sure how to include linkIssue in the same statement if the issue keys haven't yet been created in the DB.
Code I already have that works:
//Create new story and sub-task upon creation of new epic and link them to the epic. if(component == "Client Upgrade Autocreate"){ string newTaskKeyFr = createIssue("ABT", "", "Story", "Summary for first story"); %newTaskKeyFr%.description = "Description for the new story"; %newTaskKeyFr%.component = "Test"; linkIssue(parentIssueKey, newTaskkeyFR, "depends on"); string newTaskKeySc = createIssue("ABT", "", "Story", "Summary for second story"); %newTaskKeySc%.description = "Description for the second new story"; %newTaskKeySc%.component = "Test"; string newTaskKeySbOne = createIssue("ABT", "", "Sub-task", "Summary for First Sub-task"); %newTaskKeySbOne%.description = "Description for the first sub-task"; %newTaskKeySbOne%.component = "Test"; }
Can someone help me out on how to include the linkIssue in the above code. It seems like it should be fairly simple but I can't make sense of it.
https://confluence.kepler-rominfo.com/display/JJUP14/linkIssue
Avril
Hi,
First thing first, you're using outdated documentation. Use this one instead:
https://confluence.kepler-rominfo.com/display/SIL30/linkIssue
Now to the point.
If I understand correctly, you want to launch a post-function on creation of Epic and this function should create two stories and one sub-task, and then link them all to your Epic?
Try something like this:
string epicKey = key; if(component == "Client Upgrade Autocreate"){ string newTaskKeyFr = createIssue("ABT", "", "Story", "Summary for first story"); %newTaskKeyFr%.description = "Description for the new story"; %newTaskKeyFr%.component = "Test"; linkIssue(epicKey, newTaskkeyFR, "depends on"); string newTaskKeySc = createIssue("ABT", "", "Story", "Summary for second story"); %newTaskKeySc%.description = "Description for the second new story"; %newTaskKeySc%.component = "Test"; linkIssue(epicKey, newTaskkeySc, "depends on"); string newTaskKeySbOne = createIssue("ABT", newTaskKeySc, "Sub-task", "Summary for First Sub-task"); %newTaskKeySbOne%.description = "Description for the first sub-task"; %newTaskKeySbOne%.component = "Test"; linkIssue(epicKey, newTaskKeySbOne, "depends on"); }
Remember one important thing: when you will be adding the post-function to the Epic create transition, position it AFTER the "Creates the issue originally" action. This is because the EPIC has to be created first, before it can be linked to.
Second thing: above script creates "classic" links. If you want to create Epic Link instead, I think you might have to use JJupin Agile.
Blazej I wouldn't describe it better! Good job.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Blazej,
That fixed the issue and thanks also for the JJupin Agile tip. I hadn't even thought about it as requirements are still coming in.
Thank you.
Avril
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also Ms Bower, when using the linkIssue routine, be sure to use the link name, not the outward or inward issue link value.
See the following question: https://answers.atlassian.com/questions/301971
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.