I was wondering if it's possible to set an Epic Link through a SIL Script. Right now I have a script that's attached to the create transition of a workflow specifically for Epics. What I want to do is, when I create an epic, I enter all of the important information, and when I click create, not only is the epic created, but a specific number of tasks are created as well (Specified on the create screen of the epic) that are automatically populated with all of the epic's field values and linked to the epic. I tried setting it like a normal SIL custom field set (customfield_10006 = "PACK-80" and "Epic Link" = "PACK-80") but neither work. Take a look through this script, I'm attempting to set the Epic Link through the customfields[] array being used in the createIssue routine at the bottom.
if(issueType == "Epic" && project == "PACK") { string[] packTypes = customfield_13200; //load all specified packaging types into an array number packTypeNum = arraySize(packTypes); //count the array to see how many epic tasks we need to generate string epicKey = key; string brand = customfield_12300; string customer = customfield_12402; string supplier = customfield_12400; for(number count = 0; count < packTypeNum; count = count + 1) { //generate all packaging type issues (tasks) //define the required parameter values string projectKey = "PACK"; string parentIssueKey = ""; string issueType = "Task"; string issueSummary = summary + " " + packTypes[count]; string issueDescription = description; string[] customfields; customfields[0] = "Epic Link"; customfields[1] = epicKey; string[] componentsArray = components; //create the issue with the original summary + the packaging type createIssue(projectKey, parentIssueKey, issueType, issueSummary, "", issueDescription, componentsArray, (date)"", (interval)"", "", customfields); } }
You will need JJupin Agile for that. You need to save the created issue's key in a variable and then set the epic link:
//create the issue with the original summary + the packaging type string createdKey = createIssue(projectKey, parentIssueKey, issueType, issueSummary, "", issueDescription, componentsArray, (date)"", (interval)"", "", customfields); #{createdKey.Epic Link} = epicKey;
See more at https://confluence.kepler-rominfo.com/display/JJUPA30/Custom+Fields
Regards,
Silviu
Hi Silviu,
Thanks for the quick answer! Your solution didn't work, but I was able to create a second SIL Script that I attached to a post function that occurs after the one I posted above. It essentially loops through the newly created issues and assigns their epic link by using the syntax
%issue%.#{Epic Link} = epicKey;
Not sure why #{createdKey.Epic Link} didn't work, though. Regardless, thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.
Register nowOnline 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.